diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-07-21 07:15:04 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-07-21 07:15:04 +0800 |
commit | 6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8 (patch) | |
tree | 7b6a6eb86d6a0463221a502fb886bae6ff5a243c /packages | |
parent | 938aabde3db0044c658e86765e1bbdbdce4e4a17 (diff) | |
parent | e54501522dcf93521c8ff7dfe5b216cffeaa1b29 (diff) | |
download | dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.gz dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.bz2 dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.lz dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.xz dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.tar.zst dexon-sol-tools-6ffa907f0ef3c94d3ea7d79d99a24939f62e0eb8.zip |
Merge branch 'v2-prototype' into feature/website/jobs-page-part2
* v2-prototype: (103 commits)
Add changelog entry for @0xproject/utils
Add AbortController polyfill to fetchAsync in utils
Increase node heap size for webpack command
Add missing timestamp to CHANGELOG entries
Upgrade some @0xproject packages to 1.0.0 in website
Hard code fillOrder selector into abiEncodeFillOrder
Returns byte array instead of memory range for encoding fillOrder calldata
Created LibAbiEncoder with `fillOrderNoThrow`
Add missing dep in migrations
Fix the abi-gen entry point
Fix linter error
Remove the postinstall hook
Update website package.json with original imports
@0xproject/sra-report@1.0.0
Change all package to depend on the new @0xproject/connect@1.0.0
@0xproject/connect@1.0.0
Use old assert version in @0xproject/connect
FIx a typo
Remove rc versions from unmigrated packages
0x.js@1.0.0-rc.2
...
Diffstat (limited to 'packages')
112 files changed, 1030 insertions, 679 deletions
diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json index 27dafe4ca..c3b8728c6 100644 --- a/packages/0x.js/CHANGELOG.json +++ b/packages/0x.js/CHANGELOG.json @@ -1,32 +1,42 @@ [ { - "version": "1.0.0", + "timestamp": 1532043100, + "version": "1.0.0-rc.2", + "changes": [ + { + "note": "Remove `zeroEx.assetData` and instead re-export it's static functions directly off `ZeroEx`" + } + ] + }, + { + "timestamp": 1532043000, + "version": "1.0.0-rc.1", "changes": [ { "note": "Remove tokenRegistry wrapper", "pr": 863 }, { - "note": "Rename zeroEx.token to zeroEx.erc20Token, and add zeroEx.erc721Token", + "note": "Rename `zeroEx.token` to `zeroEx.erc20Token`, and add `zeroEx.erc721Token`", "pr": 863 }, { - "note": "Rename zeroEx.proxy to zeroEx.erc20Proxy and add zeroEx.erc721Proxy", + "note": "Rename `zeroEx.proxy` to `zeroEx.erc20Proxy` and add `zeroEx.erc721Proxy`", "pr": 863 }, { "note": - "Refactored ZeroEx.isValidSignature to zeroEx.isValidSignatureAsync. It is now async so that it can verify contract-dependent signature types", + "Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types", "pr": 863 }, { "note": - "Refactored signOrderHashAsync to ecSignOrderHashAsync. There are now many non-ECSignature ways to sign orders too.", + "Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.", "pr": 863 }, { "note": - "Removed createOrderWatcherAsync method. Will be added back once OrderWatcher is refactored for V2", + "Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2", "pr": 863 }, { @@ -34,11 +44,7 @@ "pr": 863 }, { - "note": "Remove stateLayer config from OrderWatcher. It now always operates on the latest block", - "pr": 875 - }, - { - "note": "Export ZeroEx.assetData with methods to decode/encode assetData fields found in 0x orders", + "note": "Export `ZeroEx.assetData` with methods to decode/encode assetData fields found in 0x orders", "pr": 884 } ] diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 538eafd59..06ffe2daf 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -1,6 +1,6 @@ { "name": "0x.js", - "version": "0.38.6", + "version": "1.0.0-rc.2", "engines": { "node": ">=6.12" }, @@ -41,8 +41,8 @@ "contracts": "ZRXToken", "postpublish": { "assets": [ - "packages/0x.js/_bundles/index.js", - "packages/0x.js/_bundles/index.min.js" + "_bundles/index.js", + "_bundles/index.min.js" ], "docPublishConfigs": { "extraFileIncludes": [ @@ -51,13 +51,11 @@ "../contract-wrappers/src/types.ts", "../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts", "../contract-wrappers/src/contract_wrappers/exchange_wrapper.ts", - "../contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts", - "../contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts", - "../contract-wrappers/src/contract_wrappers/token_wrapper.ts", - "../order-watcher/src/order_watcher/order_watcher.ts", - "./src/generated_contract_wrappers/ether_token.ts", - "./src/generated_contract_wrappers/token.ts", - "./src/generated_contract_wrappers/exchange.ts" + "../contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts", + "../contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts", + "../contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts", + "../contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts", + "../order-watcher/src/order_watcher/order_watcher.ts" ], "s3BucketPath": "s3://doc-jsons/0x.js/", "s3StagingBucketPath": "s3://staging-doc-jsons/0x.js/" @@ -70,11 +68,11 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0xproject/abi-gen": "^0.3.4", - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/migrations": "^0.0.10", - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/abi-gen": "^1.0.0", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/migrations": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", @@ -100,17 +98,17 @@ "webpack": "^3.1.0" }, "dependencies": { - "@0xproject/assert": "^0.2.14", - "@0xproject/base-contract": "^0.3.6", - "@0xproject/contract-wrappers": "^0.1.1", - "@0xproject/order-utils": "^1.0.0", - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/subproviders": "^0.10.6", - "@0xproject/types": "^1.0.0", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", - "ethereum-types": "^0.0.2", + "@0xproject/assert": "^1.0.0", + "@0xproject/base-contract": "^1.0.0", + "@0xproject/contract-wrappers": "^1.0.0-rc.1", + "@0xproject/order-utils": "^1.0.0-rc.1", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", + "ethereum-types": "^1.0.0", "ethers": "3.0.22", "lodash": "^4.17.4" }, diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts index 7c06a53af..2a2b82f63 100644 --- a/packages/0x.js/src/0x.ts +++ b/packages/0x.js/src/0x.ts @@ -39,10 +39,6 @@ export class ZeroEx { */ public static NULL_ADDRESS = constants.NULL_ADDRESS; /** - * A set of methods to easily decode/encode assetData fields found in 0x orders. - */ - public static assetData = assetDataUtils; - /** * An instance of the ExchangeWrapper class containing methods for interacting with the 0x Exchange smart contract. */ public exchange: ExchangeWrapper; @@ -126,6 +122,57 @@ export class ZeroEx { return baseUnitAmount; } /** + * Encodes an ERC20 token address into a hex encoded assetData string, usable in the makerAssetData or + * takerAssetData fields in a 0x order. + * @param tokenAddress The ERC20 token address to encode + * @return The hex encoded assetData string + */ + public static encodeERC20AssetData(tokenAddress: string): string { + return assetDataUtils.encodeERC20AssetData(tokenAddress); + } + /** + * Decodes an ERC20 assetData hex string into it's corresponding ERC20 tokenAddress & assetProxyId + * @param assetData Hex encoded assetData string to decode + * @return An object containing the decoded tokenAddress & assetProxyId + */ + public static decodeERC20AssetData(assetData: string): ERC20AssetData { + return assetDataUtils.decodeERC20AssetData(assetData); + } + /** + * Encodes an ERC721 token address into a hex encoded assetData string, usable in the makerAssetData or + * takerAssetData fields in a 0x order. + * @param tokenAddress The ERC721 token address to encode + * @param tokenId The ERC721 tokenId to encode + * @return The hex encoded assetData string + */ + public static encodeERC721AssetData(tokenAddress: string, tokenId: BigNumber): string { + return assetDataUtils.encodeERC721AssetData(tokenAddress, tokenId); + } + /** + * Decodes an ERC721 assetData hex string into it's corresponding ERC721 tokenAddress, tokenId & assetProxyId + * @param assetData Hex encoded assetData string to decode + * @return An object containing the decoded tokenAddress, tokenId & assetProxyId + */ + public static decodeERC721AssetData(assetData: string): ERC721AssetData { + return assetDataUtils.decodeERC721AssetData(assetData); + } + /** + * Decode and return the assetProxyId from the assetData + * @param assetData Hex encoded assetData string to decode + * @return The assetProxyId + */ + public static decodeAssetProxyId(assetData: string): AssetProxyId { + return assetDataUtils.decodeAssetProxyId(assetData); + } + /** + * Decode any assetData into it's corresponding assetData object + * @param assetData Hex encoded assetData string to decode + * @return Either a ERC20 or ERC721 assetData object + */ + public static decodeAssetDataOrThrow(assetData: string): ERC20AssetData | ERC721AssetData { + return assetDataUtils.decodeAssetDataOrThrow(assetData); + } + /** * Instantiates a new ZeroEx instance that provides the public interface to the 0x.js library. * @param provider The Provider instance you would like the 0x.js library to use for interacting with * the Ethereum network. diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json index 048972041..4162b943f 100644 --- a/packages/abi-gen/CHANGELOG.json +++ b/packages/abi-gen/CHANGELOG.json @@ -1,6 +1,16 @@ [ { - "version": "0.4.0", + "version": "1.0.1", + "changes": [ + { + "note": "Fix the abi-gen entry point in package.json", + "pr": 901 + } + ] + }, + { + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { "note": "Convert e_r_c to erc in generated file names", diff --git a/packages/abi-gen/bin/abi-gen.js b/packages/abi-gen/bin/abi-gen.js index 8d6bdccf8..73ffe76ed 100755 --- a/packages/abi-gen/bin/abi-gen.js +++ b/packages/abi-gen/bin/abi-gen.js @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('../lib/src/index.js') +require('../lib/src/index.js'); diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 5e52662d0..d40db09b9 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,12 +1,12 @@ { "name": "@0xproject/abi-gen", - "version": "0.3.4", + "version": "1.0.0", "engines": { "node": ">=6.12" }, "description": "Generate contract wrappers from ABI and handlebars templates", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "lib/src/index.js", + "types": "lib/src/index.d.ts", "scripts": { "watch_without_deps": "tsc -w", "lint": "tslint --project .", @@ -32,10 +32,10 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md", "dependencies": { - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", "chalk": "^2.3.0", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "glob": "^7.1.2", "handlebars": "^4.0.11", "lodash": "^4.17.4", @@ -46,8 +46,8 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/glob": "5.0.35", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json index e72b0e9a4..f06901a44 100644 --- a/packages/assert/CHANGELOG.json +++ b/packages/assert/CHANGELOG.json @@ -1,6 +1,7 @@ [ { - "version": "0.2.14", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { "note": diff --git a/packages/assert/package.json b/packages/assert/package.json index e734fa40b..1094cba85 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/assert", - "version": "0.3.0", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -31,8 +31,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", @@ -48,9 +48,9 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/json-schemas": "^1.0.0", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", + "@0xproject/json-schemas": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", "lodash": "^4.17.4", "valid-url": "^1.0.9" }, diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json index 3376a44f7..f427f0fe5 100644 --- a/packages/base-contract/CHANGELOG.json +++ b/packages/base-contract/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "timestamp": 1531919263, "version": "0.3.6", "changes": [ diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json index 32910cd80..ebd7e1bc3 100644 --- a/packages/base-contract/package.json +++ b/packages/base-contract/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/base-contract", - "version": "0.3.6", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -9,7 +9,7 @@ "types": "lib/src/index.d.ts", "scripts": { "watch_without_deps": "tsc -w", - "build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", + "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib scripts", "test": "yarn run_mocha", "rebuild_and_test": "run-s clean build test", @@ -30,8 +30,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "chai": "^4.0.1", "copyfiles": "^1.2.0", @@ -43,10 +43,10 @@ "typescript": "2.7.1" }, "dependencies": { - "ethereum-types": "^0.0.2", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", + "ethereum-types": "^1.0.0", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "ethers": "3.0.22", "lodash": "^4.17.4" }, diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index c4813f589..8ed147e76 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,10 +1,11 @@ [ { + "timestamp": 1532043000, "version": "1.0.0", "changes": [ { "note": - "Remove WebSocketOrderbookChannel from the public interface and replace with orderbookChannelFactory" + "Remove `WebSocketOrderbookChannel` from the public interface and replace with `orderbookChannelFactory`" } ] }, diff --git a/packages/connect/package.json b/packages/connect/package.json index 71fd60f6a..dfa15c3d8 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/connect", - "version": "0.6.17", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -52,18 +52,18 @@ "homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md", "dependencies": { "@0xproject/assert": "^0.2.14", - "@0xproject/json-schemas": "0.8.3", + "@0xproject/json-schemas": "^0.8.3", "@0xproject/types": "^0.8.2", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", "lodash": "^4.17.4", "query-string": "^5.0.1", "sinon": "^4.0.0", "websocket": "^1.0.25" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/fetch-mock": "^5.12.2", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index c6b5d07f7..1e82522df 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,16 +1,17 @@ [ { - "version": "1.0.0", + "timestamp": 1532043000, + "version": "1.0.0-rc.1", "changes": [ { - "note": "Update blockstream to v5.0 and propogate up caught errors to active subscriptions" + "note": "Update blockstream to v5.0 and propogate up caught errors to active subscriptions", + "pr": 815 }, { "note": "Update to v2 of 0x rpotocol", "pr": 822 } - ], - "timestamp": 1531149657 + ] }, { "timestamp": 1531919263, diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index c37030797..4f2f773fd 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/contract-wrappers", - "version": "0.1.1", + "version": "1.0.0-rc.1", "description": "Smart TS wrappers for 0x smart contracts", "keywords": [ "0xproject", @@ -26,14 +26,6 @@ "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, - "config": { - "postpublish": { - "assets": [ - "packages/contract-wrappers/_bundles/index.js", - "packages/contract-wrappers/_bundles/index.min.js" - ] - } - }, "repository": { "type": "git", "url": "https://github.com/0xProject/0x-monorepo" @@ -43,13 +35,13 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/abi-gen": "^0.3.4", - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/migrations": "^0.0.10", - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/subproviders": "^0.10.6", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/abi-gen": "^1.0.0", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/migrations": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", @@ -74,16 +66,16 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/assert": "^0.3.0", - "@0xproject/base-contract": "^0.3.6", - "@0xproject/order-utils": "^1.0.0", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", - "@0xproject/fill-scenarios": "^1.0.0", - "@0xproject/json-schemas": "^1.0.0", - "@0xproject/types": "^1.0.0", - "ethereum-types": "^0.0.2", + "@0xproject/assert": "^1.0.0", + "@0xproject/base-contract": "^1.0.0", + "@0xproject/order-utils": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", + "@0xproject/fill-scenarios": "^1.0.0-rc.1", + "@0xproject/json-schemas": "^1.0.0-rc.1", + "@0xproject/types": "^1.0.0-rc.1", + "ethereum-types": "^1.0.0", "ethereumjs-blockstream": "5.0.0", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", diff --git a/packages/contracts/package.json b/packages/contracts/package.json index e3f06f16a..7f0e97158 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -46,11 +46,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md", "devDependencies": { - "@0xproject/abi-gen": "^0.3.4", - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/tslint-config": "^0.4.21", - "@0xproject/subproviders": "^0.10.6", - "@0xproject/sol-cov": "^0.1.3", + "@0xproject/abi-gen": "^1.0.0", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/sol-cov": "^1.0.0", "@types/lodash": "4.14.104", "@types/bn.js": "^4.11.0", "@types/node": "^8.0.53", @@ -72,14 +72,14 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0xproject/base-contract": "^0.3.6", - "@0xproject/order-utils": "^1.0.0", - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/types": "^1.0.0", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", - "ethereum-types": "^0.0.2", + "@0xproject/base-contract": "^1.0.0", + "@0xproject/order-utils": "^1.0.0-rc.1", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", + "ethereum-types": "^1.0.0", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^5.1.1", diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol index d420f7e85..567f26c52 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol @@ -22,12 +22,14 @@ pragma experimental ABIEncoderV2; import "./libs/LibMath.sol"; import "./libs/LibOrder.sol"; import "./libs/LibFillResults.sol"; +import "./libs/LibAbiEncoder.sol"; import "./mixins/MExchangeCore.sol"; contract MixinWrapperFunctions is LibMath, LibFillResults, + LibAbiEncoder, MExchangeCore { /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled. @@ -68,177 +70,21 @@ contract MixinWrapperFunctions is public returns (FillResults memory fillResults) { - // We need to call MExchangeCore.fillOrder using a delegatecall in - // assembly so that we can intercept a call that throws. For this, we - // need the input encoded in memory in the Ethereum ABIv2 format [1]. - - // | Area | Offset | Length | Contents | - // | -------- |--------|---------|-------------------------------------------- | - // | Header | 0x00 | 4 | function selector | - // | Params | | 3 * 32 | function parameters: | - // | | 0x00 | | 1. offset to order (*) | - // | | 0x20 | | 2. takerAssetFillAmount | - // | | 0x40 | | 3. offset to signature (*) | - // | Data | | 12 * 32 | order: | - // | | 0x000 | | 1. senderAddress | - // | | 0x020 | | 2. makerAddress | - // | | 0x040 | | 3. takerAddress | - // | | 0x060 | | 4. feeRecipientAddress | - // | | 0x080 | | 5. makerAssetAmount | - // | | 0x0A0 | | 6. takerAssetAmount | - // | | 0x0C0 | | 7. makerFeeAmount | - // | | 0x0E0 | | 8. takerFeeAmount | - // | | 0x100 | | 9. expirationTimeSeconds | - // | | 0x120 | | 10. salt | - // | | 0x140 | | 11. Offset to makerAssetData (*) | - // | | 0x160 | | 12. Offset to takerAssetData (*) | - // | | 0x180 | 32 | makerAssetData Length | - // | | 0x1A0 | ** | makerAssetData Contents | - // | | 0x1C0 | 32 | takerAssetData Length | - // | | 0x1E0 | ** | takerAssetData Contents | - // | | 0x200 | 32 | signature Length | - // | | 0x220 | ** | signature Contents | - - // * Offsets are calculated from the beginning of the current area: Header, Params, Data: - // An offset stored in the Params area is calculated from the beginning of the Params section. - // An offset stored in the Data area is calculated from the beginning of the Data section. - - // ** The length of dynamic array contents are stored in the field immediately preceeding the contents. - - // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html - - bytes4 fillOrderSelector = this.fillOrder.selector; + // ABI encode calldata for `fillOrder` + bytes memory fillOrderCalldata = abiEncodeFillOrder( + order, + takerAssetFillAmount, + signature + ); + // Delegate to `fillOrder` and handle any exceptions gracefully assembly { - - // Areas below may use the following variables: - // 1. <area>Start -- Start of this area in memory - // 2. <area>End -- End of this area in memory. This value may - // be precomputed (before writing contents), - // or it may be computed as contents are written. - // 3. <area>Offset -- Current offset into area. If an area's End - // is precomputed, this variable tracks the - // offsets of contents as they are written. - - /////// Setup Header Area /////// - // Load free memory pointer - let headerAreaStart := mload(0x40) - mstore(headerAreaStart, fillOrderSelector) - let headerAreaEnd := add(headerAreaStart, 0x4) - - /////// Setup Params Area /////// - // This area is preallocated and written to later. - // This is because we need to fill in offsets that have not yet been calculated. - let paramsAreaStart := headerAreaEnd - let paramsAreaEnd := add(paramsAreaStart, 0x60) - let paramsAreaOffset := paramsAreaStart - - /////// Setup Data Area /////// - let dataAreaStart := paramsAreaEnd - let dataAreaEnd := dataAreaStart - - // Offset from the source data we're reading from - let sourceOffset := order - // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array. - let arrayLenBytes := 0 - let arrayLenWords := 0 - - /////// Write order Struct /////// - // Write memory location of Order, relative to the start of the - // parameter list, then increment the paramsAreaOffset respectively. - mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart)) - paramsAreaOffset := add(paramsAreaOffset, 0x20) - - // Write values for each field in the order - // It would be nice to use a loop, but we save on gas by writing - // the stores sequentially. - mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress - mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress - mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress - mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress - mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount - mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount - mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount - mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount - mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds - mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt - mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData - mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData - dataAreaEnd := add(dataAreaEnd, 0x180) - sourceOffset := add(sourceOffset, 0x180) - - // Write offset to <order.makerAssetData> - mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart)) - - // Calculate length of <order.makerAssetData> - sourceOffset := mload(add(order, 0x140)) // makerAssetData - arrayLenBytes := mload(sourceOffset) - sourceOffset := add(sourceOffset, 0x20) - arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20) - - // Write length of <order.makerAssetData> - mstore(dataAreaEnd, arrayLenBytes) - dataAreaEnd := add(dataAreaEnd, 0x20) - - // Write contents of <order.makerAssetData> - for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} { - mstore(dataAreaEnd, mload(sourceOffset)) - dataAreaEnd := add(dataAreaEnd, 0x20) - sourceOffset := add(sourceOffset, 0x20) - } - - // Write offset to <order.takerAssetData> - mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart)) - - // Calculate length of <order.takerAssetData> - sourceOffset := mload(add(order, 0x160)) // takerAssetData - arrayLenBytes := mload(sourceOffset) - sourceOffset := add(sourceOffset, 0x20) - arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20) - - // Write length of <order.takerAssetData> - mstore(dataAreaEnd, arrayLenBytes) - dataAreaEnd := add(dataAreaEnd, 0x20) - - // Write contents of <order.takerAssetData> - for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} { - mstore(dataAreaEnd, mload(sourceOffset)) - dataAreaEnd := add(dataAreaEnd, 0x20) - sourceOffset := add(sourceOffset, 0x20) - } - - /////// Write takerAssetFillAmount /////// - mstore(paramsAreaOffset, takerAssetFillAmount) - paramsAreaOffset := add(paramsAreaOffset, 0x20) - - /////// Write signature /////// - // Write offset to paramsArea - mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart)) - - // Calculate length of signature - sourceOffset := signature - arrayLenBytes := mload(sourceOffset) - sourceOffset := add(sourceOffset, 0x20) - arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20) - - // Write length of signature - mstore(dataAreaEnd, arrayLenBytes) - dataAreaEnd := add(dataAreaEnd, 0x20) - - // Write contents of signature - for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} { - mstore(dataAreaEnd, mload(sourceOffset)) - dataAreaEnd := add(dataAreaEnd, 0x20) - sourceOffset := add(sourceOffset, 0x20) - } - - // Execute delegatecall let success := delegatecall( gas, // forward all gas, TODO: look into gas consumption of assert/throw address, // call address of this contract - headerAreaStart, // pointer to start of input - sub(dataAreaEnd, headerAreaStart), // length of input - headerAreaStart, // write output over input + add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes) + mload(fillOrderCalldata), // length of input + fillOrderCalldata, // write output over input 128 // output size is 128 bytes ) switch success @@ -249,10 +95,10 @@ contract MixinWrapperFunctions is mstore(add(fillResults, 96), 0) } case 1 { - mstore(fillResults, mload(headerAreaStart)) - mstore(add(fillResults, 32), mload(add(headerAreaStart, 32))) - mstore(add(fillResults, 64), mload(add(headerAreaStart, 64))) - mstore(add(fillResults, 96), mload(add(headerAreaStart, 96))) + mstore(fillResults, mload(fillOrderCalldata)) + mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32))) + mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64))) + mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96))) } } return fillResults; diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol new file mode 100644 index 000000000..704c7061c --- /dev/null +++ b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol @@ -0,0 +1,218 @@ +/* + + Copyright 2018 ZeroEx Intl. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +pragma solidity 0.4.24; +pragma experimental ABIEncoderV2; + +import "./LibOrder.sol"; + + +contract LibAbiEncoder { + + /// @dev ABI encodes calldata for `fillOrder` in memory and returns the address range. + /// This range can be passed into `call` or `delegatecall` to invoke an external + /// call to `fillOrder`. + /// @param order Order struct containing order specifications. + /// @param takerAssetFillAmount Desired amount of takerAsset to sell. + /// @param signature Proof that order has been created by maker. + /// @return calldataBegin Memory address of ABI encoded calldata. + /// @return calldataLength Lenfgth of ABI encoded calldata. + function abiEncodeFillOrder( + LibOrder.Order memory order, + uint256 takerAssetFillAmount, + bytes memory signature + ) + public + pure + returns (bytes memory fillOrderCalldata) + { + // We need to call MExchangeCore.fillOrder using a delegatecall in + // assembly so that we can intercept a call that throws. For this, we + // need the input encoded in memory in the Ethereum ABIv2 format [1]. + + // | Area | Offset | Length | Contents | + // | -------- |--------|---------|-------------------------------------------- | + // | Header | 0x00 | 4 | function selector | + // | Params | | 3 * 32 | function parameters: | + // | | 0x00 | | 1. offset to order (*) | + // | | 0x20 | | 2. takerAssetFillAmount | + // | | 0x40 | | 3. offset to signature (*) | + // | Data | | 12 * 32 | order: | + // | | 0x000 | | 1. senderAddress | + // | | 0x020 | | 2. makerAddress | + // | | 0x040 | | 3. takerAddress | + // | | 0x060 | | 4. feeRecipientAddress | + // | | 0x080 | | 5. makerAssetAmount | + // | | 0x0A0 | | 6. takerAssetAmount | + // | | 0x0C0 | | 7. makerFeeAmount | + // | | 0x0E0 | | 8. takerFeeAmount | + // | | 0x100 | | 9. expirationTimeSeconds | + // | | 0x120 | | 10. salt | + // | | 0x140 | | 11. Offset to makerAssetData (*) | + // | | 0x160 | | 12. Offset to takerAssetData (*) | + // | | 0x180 | 32 | makerAssetData Length | + // | | 0x1A0 | ** | makerAssetData Contents | + // | | 0x1C0 | 32 | takerAssetData Length | + // | | 0x1E0 | ** | takerAssetData Contents | + // | | 0x200 | 32 | signature Length | + // | | 0x220 | ** | signature Contents | + + // * Offsets are calculated from the beginning of the current area: Header, Params, Data: + // An offset stored in the Params area is calculated from the beginning of the Params section. + // An offset stored in the Data area is calculated from the beginning of the Data section. + + // ** The length of dynamic array contents are stored in the field immediately preceeding the contents. + + // [1]: https://solidity.readthedocs.io/en/develop/abi-spec.html + + assembly { + + // Areas below may use the following variables: + // 1. <area>Start -- Start of this area in memory + // 2. <area>End -- End of this area in memory. This value may + // be precomputed (before writing contents), + // or it may be computed as contents are written. + // 3. <area>Offset -- Current offset into area. If an area's End + // is precomputed, this variable tracks the + // offsets of contents as they are written. + + /////// Setup Header Area /////// + // Load free memory pointer + fillOrderCalldata := mload(0x40) + // bytes4(keccak256("fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)")) + // = 0xb4be83d5 + // Leave 0x20 bytes to store the length + mstore(add(fillOrderCalldata, 0x20), 0xb4be83d500000000000000000000000000000000000000000000000000000000) + let headerAreaEnd := add(fillOrderCalldata, 0x24) + + /////// Setup Params Area /////// + // This area is preallocated and written to later. + // This is because we need to fill in offsets that have not yet been calculated. + let paramsAreaStart := headerAreaEnd + let paramsAreaEnd := add(paramsAreaStart, 0x60) + let paramsAreaOffset := paramsAreaStart + + /////// Setup Data Area /////// + let dataAreaStart := paramsAreaEnd + let dataAreaEnd := dataAreaStart + + // Offset from the source data we're reading from + let sourceOffset := order + // arrayLenBytes and arrayLenWords track the length of a dynamically-allocated bytes array. + let arrayLenBytes := 0 + let arrayLenWords := 0 + + /////// Write order Struct /////// + // Write memory location of Order, relative to the start of the + // parameter list, then increment the paramsAreaOffset respectively. + mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart)) + paramsAreaOffset := add(paramsAreaOffset, 0x20) + + // Write values for each field in the order + // It would be nice to use a loop, but we save on gas by writing + // the stores sequentially. + mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress + mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress + mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress + mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // senderAddress + mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // makerAssetAmount + mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // takerAssetAmount + mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // makerFeeAmount + mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // takerFeeAmount + mstore(add(dataAreaEnd, 0x100), mload(add(sourceOffset, 0x100))) // expirationTimeSeconds + mstore(add(dataAreaEnd, 0x120), mload(add(sourceOffset, 0x120))) // salt + mstore(add(dataAreaEnd, 0x140), mload(add(sourceOffset, 0x140))) // Offset to makerAssetData + mstore(add(dataAreaEnd, 0x160), mload(add(sourceOffset, 0x160))) // Offset to takerAssetData + dataAreaEnd := add(dataAreaEnd, 0x180) + sourceOffset := add(sourceOffset, 0x180) + + // Write offset to <order.makerAssetData> + mstore(add(dataAreaStart, mul(10, 0x20)), sub(dataAreaEnd, dataAreaStart)) + + // Calculate length of <order.makerAssetData> + sourceOffset := mload(add(order, 0x140)) // makerAssetData + arrayLenBytes := mload(sourceOffset) + sourceOffset := add(sourceOffset, 0x20) + arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20) + + // Write length of <order.makerAssetData> + mstore(dataAreaEnd, arrayLenBytes) + dataAreaEnd := add(dataAreaEnd, 0x20) + + // Write contents of <order.makerAssetData> + for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} { + mstore(dataAreaEnd, mload(sourceOffset)) + dataAreaEnd := add(dataAreaEnd, 0x20) + sourceOffset := add(sourceOffset, 0x20) + } + + // Write offset to <order.takerAssetData> + mstore(add(dataAreaStart, mul(11, 0x20)), sub(dataAreaEnd, dataAreaStart)) + + // Calculate length of <order.takerAssetData> + sourceOffset := mload(add(order, 0x160)) // takerAssetData + arrayLenBytes := mload(sourceOffset) + sourceOffset := add(sourceOffset, 0x20) + arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20) + + // Write length of <order.takerAssetData> + mstore(dataAreaEnd, arrayLenBytes) + dataAreaEnd := add(dataAreaEnd, 0x20) + + // Write contents of <order.takerAssetData> + for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} { + mstore(dataAreaEnd, mload(sourceOffset)) + dataAreaEnd := add(dataAreaEnd, 0x20) + sourceOffset := add(sourceOffset, 0x20) + } + + /////// Write takerAssetFillAmount /////// + mstore(paramsAreaOffset, takerAssetFillAmount) + paramsAreaOffset := add(paramsAreaOffset, 0x20) + + /////// Write signature /////// + // Write offset to paramsArea + mstore(paramsAreaOffset, sub(dataAreaEnd, paramsAreaStart)) + + // Calculate length of signature + sourceOffset := signature + arrayLenBytes := mload(sourceOffset) + sourceOffset := add(sourceOffset, 0x20) + arrayLenWords := div(add(arrayLenBytes, 0x1F), 0x20) + + // Write length of signature + mstore(dataAreaEnd, arrayLenBytes) + dataAreaEnd := add(dataAreaEnd, 0x20) + + // Write contents of signature + for {let i := 0} lt(i, arrayLenWords) {i := add(i, 1)} { + mstore(dataAreaEnd, mload(sourceOffset)) + dataAreaEnd := add(dataAreaEnd, 0x20) + sourceOffset := add(sourceOffset, 0x20) + } + + // Set length of calldata + mstore( + fillOrderCalldata, + sub(dataAreaEnd, add(fillOrderCalldata, 0x20)) + ) + } + + return fillOrderCalldata; + } +} diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json index d092ddf55..f94fd5f30 100644 --- a/packages/dev-utils/CHANGELOG.json +++ b/packages/dev-utils/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "timestamp": 1531919263, "version": "0.4.6", "changes": [ diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 3267f98d9..7a1f3c4ff 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/dev-utils", - "version": "0.4.6", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -30,8 +30,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "chai": "^4.0.1", @@ -45,12 +45,12 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/subproviders": "^0.10.6", - "@0xproject/types": "^0.8.2", - "@0xproject/utils": "^0.7.3", - "ethereum-types": "^0.0.2", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/web3-wrapper": "^0.7.3", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/utils": "^1.0.0", + "ethereum-types": "^1.0.0", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "lodash": "^4.17.4" }, "publishConfig": { diff --git a/packages/ethereum-types/CHANGELOG.json b/packages/ethereum-types/CHANGELOG.json index 351e9c23f..70a2ffcb0 100644 --- a/packages/ethereum-types/CHANGELOG.json +++ b/packages/ethereum-types/CHANGELOG.json @@ -1,6 +1,7 @@ [ { - "version": "0.0.3", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { "note": "Add `TraceParams` interface for `debug_traceTransaction` parameters", diff --git a/packages/ethereum-types/package.json b/packages/ethereum-types/package.json index e8652383d..5a3a8c0f3 100644 --- a/packages/ethereum-types/package.json +++ b/packages/ethereum-types/package.json @@ -1,6 +1,6 @@ { "name": "ethereum-types", - "version": "0.0.2", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -35,8 +35,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/ethereum-types/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.1", - "@0xproject/tslint-config": "^0.4.20", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json index b22976d9b..e1e8a9d6d 100644 --- a/packages/fill-scenarios/CHANGELOG.json +++ b/packages/fill-scenarios/CHANGELOG.json @@ -1,6 +1,7 @@ [ { - "version": "1.0.0", + "timestamp": 1532043000, + "version": "1.0.0-rc.1", "changes": [ { "note": "Make fill-scenarios compatible with V2 of 0x protocol", diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json index 45eb1ea6d..b6b1d8dce 100644 --- a/packages/fill-scenarios/package.json +++ b/packages/fill-scenarios/package.json @@ -1,12 +1,12 @@ { "name": "@0xproject/fill-scenarios", - "version": "1.0.0", + "version": "1.0.0-rc.1", "description": "0x order fill scenario generator", "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { "watch_without_deps": "yarn pre_build && tsc -w", - "build": "yarn pre_build && tsc", + "build": "yarn pre_build && tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", "pre_build": "run-s update_artifacts generate_contract_wrappers", "update_artifacts": "for i in ${npm_package_config_contracts}; do copyfiles -u 4 ../migrations/artifacts/2.0.0/$i.json lib/artifacts; done;", "generate_contract_wrappers": "abi-gen --abis 'lib/artifacts/@(Exchange|DummyERC20Token|DummyERC721Token).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers", @@ -28,10 +28,10 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md", "devDependencies": { - "@0xproject/abi-gen": "^0.3.4", - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/abi-gen": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", @@ -41,13 +41,13 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/base-contract": "^0.3.6", - "@0xproject/order-utils": "^1.0.0", - "@0xproject/types": "1.0.0", - "ethereum-types": "^0.0.2", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", + "@0xproject/base-contract": "^1.0.0", + "@0xproject/order-utils": "^1.0.0-rc.1", + "@0xproject/types": "^1.0.0-rc.1", + "ethereum-types": "^1.0.0", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "ethers": "3.0.22", "lodash": "^4.17.4" }, diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index 2f8f2573f..8bffe6955 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,14 +1,19 @@ [ { - "version": "1.0.0", + "timestamp": 1532043000, + "version": "1.0.0-rc.1", "changes": [ { - "note": "Update schemas for V2", + "note": "Update schemas for V2 or 0x Protocol", "pr": 615 }, { "note": "Added CallData schema", "pr": 821 + }, + { + "note": "Update CallData schema id to CallData", + "pr": 894 } ] }, diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index 09360fa05..87182831f 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/json-schemas", - "version": "1.0.0", + "version": "1.0.0-rc.1", "engines": { "node": ">=6.12" }, @@ -47,15 +47,15 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md", "dependencies": { - "@0xproject/typescript-typings": "^0.4.3", + "@0xproject/typescript-typings": "^1.0.0", "@types/node": "^8.0.53", "jsonschema": "^1.2.0", "lodash.values": "^4.3.0" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", - "@0xproject/utils": "^0.7.3", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", + "@0xproject/utils": "^1.0.0", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", diff --git a/packages/json-schemas/schemas/call_data_schema.ts b/packages/json-schemas/schemas/call_data_schema.ts index e8fcc7512..b9d00ad2a 100644 --- a/packages/json-schemas/schemas/call_data_schema.ts +++ b/packages/json-schemas/schemas/call_data_schema.ts @@ -1,5 +1,5 @@ export const callDataSchema = { - id: '/TxData', + id: '/CallData', properties: { from: { $ref: '/Address' }, to: { $ref: '/Address' }, diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index 779be6673..66e0e5cf0 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -29,25 +29,25 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@0xproject/abi-gen": "^0.3.4", - "@0xproject/base-contract": "^0.3.6", - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/sol-cov": "^0.1.3", - "@0xproject/subproviders": "^0.10.6", - "@0xproject/tslint-config": "^0.4.21", - "@0xproject/types": "^0.8.2", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", + "@0xproject/abi-gen": "^1.0.0", + "@0xproject/base-contract": "^1.0.0", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/sol-cov": "^1.0.0", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "@types/mocha": "^5.2.2", "copyfiles": "^2.0.0", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "ethers": "3.0.22", "lodash": "^4.17.4", "run-s": "^0.0.0" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.6", + "@0xproject/dev-utils": "^1.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-bignumber": "^2.0.1", diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index ac9309a3b..e0a5c8a52 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Added migrations for 0x Protocol v2" + } + ] + }, + { "timestamp": 1531919263, "version": "0.0.10", "changes": [ diff --git a/packages/migrations/package.json b/packages/migrations/package.json index 866de792b..ac4d7e965 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/migrations", - "version": "0.0.10", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -9,7 +9,8 @@ "types": "lib/index.d.ts", "scripts": { "watch_without_deps": "yarn pre_build && tsc -w", - "build": "yarn pre_build && tsc", + "build": "yarn pre_build && tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", + "manual:postpublish": "yarn build; node ./scripts/postpublish.js", "pre_build": "run-s copy_artifacts generate_contract_wrappers", "copy_artifacts": "copyfiles 'artifacts/**/*' ./lib", "clean": "shx rm -rf lib src/contract_wrappers", @@ -37,11 +38,13 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0xproject/abi-gen": "^0.3.4", - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/tslint-config": "^0.4.21", - "@0xproject/types": "^0.8.2", + "@0xproject/abi-gen": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", + "@0xproject/types": "^1.0.0-rc.1", "@types/yargs": "^10.0.0", + "copyfiles": "^1.2.0", "yargs": "^10.0.3", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", @@ -50,15 +53,15 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/base-contract": "^0.3.6", - "@0xproject/order-utils": "^1.0.0", - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/subproviders": "^0.10.6", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", + "@0xproject/base-contract": "^1.0.0", + "@0xproject/order-utils": "^1.0.0-rc.1", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "@ledgerhq/hw-app-eth": "^4.3.0", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "ethers": "3.0.22", "lodash": "^4.17.4" }, diff --git a/packages/migrations/src/monorepo_scripts/postpublish.ts b/packages/migrations/src/monorepo_scripts/postpublish.ts new file mode 100644 index 000000000..dcb99d0f7 --- /dev/null +++ b/packages/migrations/src/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/monorepo-scripts/CHANGELOG.json b/packages/monorepo-scripts/CHANGELOG.json index 8cf8c60c6..cdac2d278 100644 --- a/packages/monorepo-scripts/CHANGELOG.json +++ b/packages/monorepo-scripts/CHANGELOG.json @@ -1,10 +1,14 @@ [ { - "version": "0.2.3", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { "note": "Fix git remote tag removal step & add an additional sanity assertion", "pr": 803 + }, + { + "note": "Make PR numbers links on Github releases" } ] }, diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json index f3a6aa793..e73a27aae 100644 --- a/packages/monorepo-scripts/package.json +++ b/packages/monorepo-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/monorepo-scripts", - "version": "0.2.2", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -33,12 +33,11 @@ "@types/node": "^8.0.53", "@types/opn": "^5.1.0", "@types/rimraf": "^2.0.2", + "@types/semver": "5.5.0", "depcheck": "^0.6.9", - "lerna-get-packages": "^1.0.0", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", "shx": "^0.2.2", - "@types/semver": "5.5.0", "tslint": "5.11.0", "typescript": "2.7.1" }, @@ -56,8 +55,8 @@ "prompt": "^1.0.0", "publish-release": "0xproject/publish-release", "rimraf": "^2.6.2", - "semver-diff": "^2.1.0", "semver": "5.5.0", + "semver-diff": "^2.1.0", "semver-sort": "0.0.4" }, "publishConfig": { diff --git a/packages/monorepo-scripts/src/constants.ts b/packages/monorepo-scripts/src/constants.ts index 3aaf881cb..f08313bd2 100644 --- a/packages/monorepo-scripts/src/constants.ts +++ b/packages/monorepo-scripts/src/constants.ts @@ -3,6 +3,6 @@ import * as path from 'path'; export const constants = { monorepoRootPath: path.join(__dirname, '../../..'), stagingWebsite: 'http://staging-0xproject.s3-website-us-east-1.amazonaws.com', - lernaExecutable: path.join('node_modules', 'lerna', 'bin', 'lerna.js'), + lernaExecutable: path.join('node_modules', 'lerna', 'cli.js'), githubPersonalAccessToken: process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS, }; diff --git a/packages/monorepo-scripts/src/find_unused_dependencies.ts b/packages/monorepo-scripts/src/find_unused_dependencies.ts index 11e48ab13..4bb4b7dc5 100644 --- a/packages/monorepo-scripts/src/find_unused_dependencies.ts +++ b/packages/monorepo-scripts/src/find_unused_dependencies.ts @@ -1,7 +1,6 @@ #!/usr/bin/env node import * as depcheckAsync from 'depcheck'; -import lernaGetPackages = require('lerna-get-packages'); import * as _ from 'lodash'; import { constants } from './constants'; @@ -13,15 +12,15 @@ const IGNORE_PACKAGES = ['@0xproject/sol-compiler']; (async () => { utils.log('*** NOTE: Not all deps listed here are actually not required. ***'); utils.log("*** `depcheck` isn't perfect so double check before actually removing any. ***\n"); - const lernaPackages = lernaGetPackages(constants.monorepoRootPath); - for (const lernaPackage of lernaPackages) { - if (_.includes(IGNORE_PACKAGES, lernaPackage.package.name)) { + const packages = utils.getPackages(constants.monorepoRootPath); + for (const pkg of packages) { + if (_.includes(IGNORE_PACKAGES, pkg.packageJson.name)) { continue; // skip } - utils.log(`Checking ${lernaPackage.package.name} for unused deps. This might take a while...`); + utils.log(`Checking ${pkg.packageJson.name} for unused deps. This might take a while...`); const configs = {}; - const { dependencies } = await depcheckAsync(lernaPackage.location, configs); + const { dependencies } = await depcheckAsync(pkg.location, configs); if (!_.isEmpty(dependencies)) { _.each(dependencies, dep => { utils.log(dep); diff --git a/packages/monorepo-scripts/src/globals.d.ts b/packages/monorepo-scripts/src/globals.d.ts index 1693a6dbb..cb6a61b55 100644 --- a/packages/monorepo-scripts/src/globals.d.ts +++ b/packages/monorepo-scripts/src/globals.d.ts @@ -13,23 +13,4 @@ declare module 'semver-sort' { const desc: (versions: string[]) => string[]; } -declare interface LernaPackage { - location: string; - package: { - private?: boolean; - version: string; - name: string; - main?: string; - scripts?: { [command: string]: 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/postpublish_utils.ts b/packages/monorepo-scripts/src/postpublish_utils.ts index 85b32ed83..3ecb7b7c5 100644 --- a/packages/monorepo-scripts/src/postpublish_utils.ts +++ b/packages/monorepo-scripts/src/postpublish_utils.ts @@ -128,7 +128,7 @@ export const postpublishUtils = { _.each(latestLog.changes, change => { notes += `* ${change.note}`; if (change.pr) { - notes += ` (${change.pr})`; + notes += ` (#${change.pr})`; } notes += `\n`; }); diff --git a/packages/monorepo-scripts/src/prepublish_checks.ts b/packages/monorepo-scripts/src/prepublish_checks.ts index 3b4ff9082..431e848ca 100644 --- a/packages/monorepo-scripts/src/prepublish_checks.ts +++ b/packages/monorepo-scripts/src/prepublish_checks.ts @@ -4,34 +4,33 @@ import semver = require('semver'); import semverSort = require('semver-sort'); import { constants } from './constants'; +import { Package } from './types'; import { changelogUtils } from './utils/changelog_utils'; import { npmUtils } from './utils/npm_utils'; import { utils } from './utils/utils'; async function prepublishChecksAsync(): Promise<void> { const shouldIncludePrivate = false; - const updatedPublicLernaPackages = await utils.getUpdatedLernaPackagesAsync(shouldIncludePrivate); + const updatedPublicPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate); - await checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(updatedPublicLernaPackages); - await checkChangelogFormatAsync(updatedPublicLernaPackages); - await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicLernaPackages); + await checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(updatedPublicPackages); + await checkChangelogFormatAsync(updatedPublicPackages); + await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages); await checkPublishRequiredSetupAsync(); } -async function checkGitTagsForNextVersionAndDeleteIfExistAsync( - updatedPublicLernaPackages: LernaPackage[], -): Promise<void> { - const packageNames = _.map(updatedPublicLernaPackages, lernaPackage => lernaPackage.package.name); +async function checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages: Package[]): Promise<void> { + const packageNames = _.map(updatedPublicPackages, pkg => pkg.packageJson.name); const localGitTags = await utils.getLocalGitTagsAsync(); const localTagVersionsByPackageName = await utils.getGitTagsByPackageNameAsync(packageNames, localGitTags); const remoteGitTags = await utils.getRemoteGitTagsAsync(); const remoteTagVersionsByPackageName = await utils.getGitTagsByPackageNameAsync(packageNames, remoteGitTags); - for (const lernaPackage of updatedPublicLernaPackages) { - const currentVersion = lernaPackage.package.version; - const packageName = lernaPackage.package.name; - const packageLocation = lernaPackage.location; + for (const pkg of updatedPublicPackages) { + const currentVersion = pkg.packageJson.version; + const packageName = pkg.packageJson.name; + const packageLocation = pkg.location; const nextVersion = await utils.getNextPackageVersionAsync(currentVersion, packageName, packageLocation); const remoteTagVersions = remoteTagVersionsByPackageName[packageName]; @@ -49,13 +48,13 @@ async function checkGitTagsForNextVersionAndDeleteIfExistAsync( } async function checkCurrentVersionMatchesLatestPublishedNPMPackageAsync( - updatedPublicLernaPackages: LernaPackage[], + updatedPublicPackages: Package[], ): Promise<void> { utils.log('Check package versions against npmjs.org...'); const versionMismatches = []; - for (const lernaPackage of updatedPublicLernaPackages) { - const packageName = lernaPackage.package.name; - const packageVersion = lernaPackage.package.version; + for (const pkg of updatedPublicPackages) { + const packageName = pkg.packageJson.name; + const packageVersion = pkg.packageJson.version; const packageRegistryJsonIfExists = await npmUtils.getPackageRegistryJsonIfExistsAsync(packageName); if (_.isUndefined(packageRegistryJsonIfExists)) { continue; // noop for packages not yet published to NPM @@ -84,14 +83,14 @@ async function checkCurrentVersionMatchesLatestPublishedNPMPackageAsync( } } -async function checkChangelogFormatAsync(updatedPublicLernaPackages: LernaPackage[]): Promise<void> { +async function checkChangelogFormatAsync(updatedPublicPackages: Package[]): Promise<void> { utils.log('Check CHANGELOGs for inconsistencies...'); const changeLogInconsistencies = []; - for (const lernaPackage of updatedPublicLernaPackages) { - const packageName = lernaPackage.package.name; - const changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, lernaPackage.location); + for (const pkg of updatedPublicPackages) { + const packageName = pkg.packageJson.name; + const changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, pkg.location); - const currentVersion = lernaPackage.package.version; + const currentVersion = pkg.packageJson.version; if (!_.isEmpty(changelog)) { const lastEntry = changelog[0]; const doesLastEntryHaveTimestamp = !_.isUndefined(lastEntry.timestamp); @@ -105,7 +104,7 @@ async function checkChangelogFormatAsync(updatedPublicLernaPackages: LernaPackag // Remove incorrectly added timestamp delete changelog[0].timestamp; // Save updated CHANGELOG.json - await changelogUtils.writeChangelogJsonFileAsync(lernaPackage.location, changelog); + await changelogUtils.writeChangelogJsonFileAsync(pkg.location, changelog); utils.log(`${packageName}: Removed timestamp from latest CHANGELOG.json entry.`); } } diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index 72c6c0a71..c44e1f85e 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -11,7 +11,7 @@ import semverDiff = require('semver-diff'); import semverSort = require('semver-sort'); import { constants } from './constants'; -import { PackageToVersionChange, SemVerIndex, VersionChangelog } from './types'; +import { Package, PackageToVersionChange, SemVerIndex, VersionChangelog } from './types'; import { changelogUtils } from './utils/changelog_utils'; import { utils } from './utils/utils'; @@ -34,19 +34,20 @@ const packageNameToWebsitePath: { [name: string]: string } = { 'sol-cov': 'sol-cov', subproviders: 'subproviders', 'order-utils': 'order-utils', + 'ethereum-types': 'ethereum-types', }; (async () => { // Fetch public, updated Lerna packages const shouldIncludePrivate = false; - const updatedPublicLernaPackages = await utils.getUpdatedLernaPackagesAsync(shouldIncludePrivate); + const updatedPublicPackages = await utils.getUpdatedPackagesAsync(shouldIncludePrivate); - await confirmDocPagesRenderAsync(updatedPublicLernaPackages); + await confirmDocPagesRenderAsync(updatedPublicPackages); // Update CHANGELOGs - const updatedPublicLernaPackageNames = _.map(updatedPublicLernaPackages, pkg => pkg.package.name); - utils.log(`Will update CHANGELOGs and publish: \n${updatedPublicLernaPackageNames.join('\n')}\n`); - const packageToVersionChange = await updateChangeLogsAsync(updatedPublicLernaPackages); + const updatedPublicPackageNames = _.map(updatedPublicPackages, pkg => pkg.packageJson.name); + utils.log(`Will update CHANGELOGs and publish: \n${updatedPublicPackageNames.join('\n')}\n`); + const packageToVersionChange = await updateChangeLogsAsync(updatedPublicPackages); // Push changelog changes to Github if (!IS_DRY_RUN) { @@ -65,7 +66,7 @@ const packageNameToWebsitePath: { [name: string]: string } = { process.exit(1); }); -async function confirmDocPagesRenderAsync(packages: LernaPackage[]): Promise<void> { +async function confirmDocPagesRenderAsync(packages: Package[]): Promise<void> { // push docs to staging utils.log("Upload all docJson's to S3 staging..."); await execAsync(`yarn stage_docs`, { cwd: constants.monorepoRootPath }); @@ -76,14 +77,14 @@ async function confirmDocPagesRenderAsync(packages: LernaPackage[]): Promise<voi await execAsync(`yarn deploy_staging`, { cwd: pathToWebsite }); const packagesWithDocs = _.filter(packages, pkg => { - const scriptsIfExists = pkg.package.scripts; + const scriptsIfExists = pkg.packageJson.scripts; if (_.isUndefined(scriptsIfExists)) { throw new Error('Found a public package without any scripts in package.json'); } return !_.isUndefined(scriptsIfExists[DOC_GEN_COMMAND]); }); _.each(packagesWithDocs, pkg => { - const name = pkg.package.name; + const name = pkg.packageJson.name; const nameWithoutPrefix = _.startsWith(name, NPM_NAMESPACE) ? name.split('@0xproject/')[1] : name; const docSegmentIfExists = packageNameToWebsitePath[nameWithoutPrefix]; if (_.isUndefined(docSegmentIfExists)) { @@ -114,15 +115,15 @@ async function pushChangelogsToGithubAsync(): Promise<void> { utils.log(`Pushed CHANGELOG updates to Github`); } -async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[]): Promise<PackageToVersionChange> { +async function updateChangeLogsAsync(updatedPublicPackages: Package[]): Promise<PackageToVersionChange> { const packageToVersionChange: PackageToVersionChange = {}; - for (const lernaPackage of updatedPublicLernaPackages) { - const packageName = lernaPackage.package.name; - let changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, lernaPackage.location); + for (const pkg of updatedPublicPackages) { + const packageName = pkg.packageJson.name; + let changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, pkg.location); - const currentVersion = lernaPackage.package.version; + const currentVersion = pkg.packageJson.version; const shouldAddNewEntry = changelogUtils.shouldAddNewChangelogEntry( - lernaPackage.package.name, + pkg.packageJson.name, currentVersion, changelog, ); @@ -157,11 +158,11 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[]) } // Save updated CHANGELOG.json - await changelogUtils.writeChangelogJsonFileAsync(lernaPackage.location, changelog); + await changelogUtils.writeChangelogJsonFileAsync(pkg.location, changelog); utils.log(`${packageName}: Updated CHANGELOG.json`); // Generate updated CHANGELOG.md const changelogMd = changelogUtils.generateChangelogMd(changelog); - await changelogUtils.writeChangelogMdFileAsync(lernaPackage.location, changelogMd); + await changelogUtils.writeChangelogMdFileAsync(pkg.location, changelogMd); utils.log(`${packageName}: Updated CHANGELOG.md`); } diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index b67154667..668d4ef1d 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -1,7 +1,6 @@ #!/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'; @@ -11,17 +10,14 @@ import { utils } from './utils/utils'; (async () => { const monorepoRootPath = path.join(__dirname, '../../..'); - const lernaPackages = lernaGetPackages(monorepoRootPath); + const packages = utils.getPackages(monorepoRootPath); const installablePackages = _.filter( - lernaPackages, - lernaPackage => - !lernaPackage.package.private && - !_.isUndefined(lernaPackage.package.main) && - lernaPackage.package.main.endsWith('.js'), + packages, + pkg => !pkg.packageJson.private && !_.isUndefined(pkg.packageJson.main) && pkg.packageJson.main.endsWith('.js'), ); - for (const installableLernaPackage of installablePackages) { - const packagePath = installableLernaPackage.location; - const packageName = installableLernaPackage.package.name; + for (const installablePackage of installablePackages) { + const packagePath = installablePackage.location; + const packageName = installablePackage.packageJson.name; utils.log(`Testing ${packageName}`); let result = await execAsync('npm pack', { cwd: packagePath }); const packedPackageFileName = result.stdout.trim(); diff --git a/packages/monorepo-scripts/src/types.ts b/packages/monorepo-scripts/src/types.ts index 61bd75732..9f991c86c 100644 --- a/packages/monorepo-scripts/src/types.ts +++ b/packages/monorepo-scripts/src/types.ts @@ -40,3 +40,17 @@ export interface PackageRegistryJson { export interface GitTagsByPackageName { [packageName: string]: string[]; } + +export interface Package { + location: string; + packageJson: { + private?: boolean; + version: string; + name: string; + main?: string; + scripts?: { [command: string]: string }; + config?: { + additionalTsTypings?: string[]; + }; + }; +} diff --git a/packages/monorepo-scripts/src/utils/utils.ts b/packages/monorepo-scripts/src/utils/utils.ts index be3ad950f..8ba59c81d 100644 --- a/packages/monorepo-scripts/src/utils/utils.ts +++ b/packages/monorepo-scripts/src/utils/utils.ts @@ -1,10 +1,10 @@ -import lernaGetPackages = require('lerna-get-packages'); +import * as fs from 'fs'; import * as _ from 'lodash'; import { exec as execAsync } from 'promisify-child-process'; import semver = require('semver'); import { constants } from '../constants'; -import { GitTagsByPackageName, UpdatedPackage } from '../types'; +import { GitTagsByPackageName, Package, UpdatedPackage } from '../types'; import { changelogUtils } from './changelog_utils'; @@ -12,15 +12,47 @@ export const utils = { log(...args: any[]): void { console.log(...args); // tslint:disable-line:no-console }, - async getUpdatedLernaPackagesAsync(shouldIncludePrivate: boolean): Promise<LernaPackage[]> { + getPackages(rootDir: string): Package[] { + const rootPackageJsonString = fs.readFileSync(`${rootDir}/package.json`, 'utf8'); + const rootPackageJson = JSON.parse(rootPackageJsonString); + if (_.isUndefined(rootPackageJson.workspaces)) { + throw new Error(`Did not find 'workspaces' key in root package.json`); + } + const packages = []; + for (const workspace of rootPackageJson.workspaces) { + // HACK: Remove allowed wildcards from workspace entries. + // This might be entirely comprehensive. + const workspacePath = workspace.replace('*', '').replace('**/*', ''); + const subpackageNames = fs.readdirSync(`${rootDir}/${workspacePath}`); + for (const subpackageName of subpackageNames) { + if (_.startsWith(subpackageName, '.')) { + continue; + } + const pathToPackageJson = `${rootDir}/${workspacePath}${subpackageName}`; + try { + const packageJsonString = fs.readFileSync(`${pathToPackageJson}/package.json`, 'utf8'); + const packageJson = JSON.parse(packageJsonString); + const pkg = { + location: pathToPackageJson, + packageJson, + }; + packages.push(pkg); + } catch (err) { + utils.log(`Couldn't find a 'package.json' for ${subpackageName}. Skipping.`); + } + } + } + return packages; + }, + async getUpdatedPackagesAsync(shouldIncludePrivate: boolean): Promise<Package[]> { const updatedPublicPackages = await utils.getLernaUpdatedPackagesAsync(shouldIncludePrivate); const updatedPackageNames = _.map(updatedPublicPackages, pkg => pkg.name); - const allLernaPackages = lernaGetPackages(constants.monorepoRootPath); - const updatedPublicLernaPackages = _.filter(allLernaPackages, pkg => { - return _.includes(updatedPackageNames, pkg.package.name); + const allPackages = utils.getPackages(constants.monorepoRootPath); + const updatedPackages = _.filter(allPackages, pkg => { + return _.includes(updatedPackageNames, pkg.packageJson.name); }); - return updatedPublicLernaPackages; + return updatedPackages; }, async getLernaUpdatedPackagesAsync(shouldIncludePrivate: boolean): Promise<UpdatedPackage[]> { const result = await execAsync(`${constants.lernaExecutable} updated --json`, { diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index 4358c2c9c..d74ba90ea 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -1,6 +1,7 @@ [ { - "version": "1.0.0", + "timestamp": 1532043000, + "version": "1.0.0-rc.1", "changes": [ { "note": "Refactor to work with V2 of 0x protocol", @@ -9,6 +10,10 @@ { "note": "Export parseECSignature method", "pr": 684 + }, + { + "note": "Handle Typed Arrays when hashing data", + "pr": 894 } ] }, diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 1ac2804d7..b87ae5223 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/order-utils", - "version": "1.0.0", + "version": "1.0.0-rc.1", "engines": { "node": ">=6.12" }, @@ -51,9 +51,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md", "devDependencies": { - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", "chai": "^4.0.1", @@ -71,17 +71,17 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/assert": "^0.3.0", - "@0xproject/base-contract": "^0.3.6", - "@0xproject/json-schemas": "1.0.0", - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/types": "^1.0.0", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", + "@0xproject/assert": "^1.0.0", + "@0xproject/base-contract": "^1.0.0", + "@0xproject/json-schemas": "^1.0.0-rc.1", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "@types/node": "^8.0.53", "bn.js": "^4.11.8", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", diff --git a/packages/order-utils/src/crypto.ts b/packages/order-utils/src/crypto.ts index 517ca2840..0f1504a72 100644 --- a/packages/order-utils/src/crypto.ts +++ b/packages/order-utils/src/crypto.ts @@ -32,7 +32,7 @@ export const crypto = { argTypes.push('address'); } else if (_.isString(arg)) { argTypes.push('string'); - } else if (_.isBuffer(arg)) { + } else if (_.isBuffer(arg) || _.isTypedArray(arg)) { argTypes.push('bytes'); } else if (_.isBoolean(arg)) { argTypes.push('bool'); diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index a8f935f6d..03b6f0da6 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0-rc.1", + "changes": [ + { + "note": "Add support for ERC721 event watching and Exchange V2 events", + "pr": 887 + } + ] + }, + { "timestamp": 1531919263, "version": "0.0.8", "changes": [ diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 65ead4511..2fc177db5 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/order-watcher", - "version": "0.0.8", + "version": "1.0.0-rc.1", "description": "An order watcher daemon that watches for order validity", "keywords": [ "0x", @@ -30,13 +30,7 @@ }, "config": { "compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry", - "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy_v1 MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", - "postpublish": { - "assets": [ - "packages/order-watcher/_bundles/index.js", - "packages/order-watcher/_bundles/index.min.js" - ] - } + "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy_v1 MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels" }, "repository": { "type": "git", @@ -47,12 +41,12 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/abi-gen": "^0.3.4", - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/migrations": "^0.0.10", - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/abi-gen": "^1.0.0", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/migrations": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/bintrees": "^1.0.2", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", @@ -77,18 +71,18 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/assert": "0.3.0", - "@0xproject/base-contract": "0.3.6", - "@0xproject/contract-wrappers": "0.1.1", - "@0xproject/fill-scenarios": "1.0.0", - "@0xproject/json-schemas": "1.0.0", - "@0xproject/order-utils": "1.0.0", - "@0xproject/types": "1.0.0", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", + "@0xproject/assert": "^1.0.0", + "@0xproject/base-contract": "^1.0.0", + "@0xproject/contract-wrappers": "^1.0.0-rc.1", + "@0xproject/fill-scenarios": "^1.0.0-rc.1", + "@0xproject/json-schemas": "^1.0.0-rc.1", + "@0xproject/order-utils": "^1.0.0-rc.1", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "ethereumjs-blockstream": "5.0.0", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "bintrees": "^1.0.2", "ethers": "3.0.22", "lodash": "^4.17.4" diff --git a/packages/react-docs-example/package.json b/packages/react-docs-example/package.json index 2ccba3e41..f71b718de 100644 --- a/packages/react-docs-example/package.json +++ b/packages/react-docs-example/package.json @@ -26,7 +26,7 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", @@ -50,7 +50,7 @@ "webpack-dev-server": "^2.11.1" }, "dependencies": { - "@0xproject/react-docs": "^0.0.16", + "@0xproject/react-docs": "^1.0.0", "basscss": "^8.0.3", "lodash": "^4.17.4", "material-ui": "^0.17.1", diff --git a/packages/react-docs-example/ts/docs.tsx b/packages/react-docs-example/ts/docs.tsx index b70de1257..bb605806f 100644 --- a/packages/react-docs-example/ts/docs.tsx +++ b/packages/react-docs-example/ts/docs.tsx @@ -14,7 +14,7 @@ import * as v0TypeDocJson from './json/0.1.12.json'; import * as v2TypeDocJson from './json/0.2.0.json'; // tslint:disable-next-line:no-implicit-dependencies no-var-requires -const IntroMarkdown = require('md/introduction'); +const IntroMarkdownV1 = require('md/introduction'); const docSections = { introduction: 'introduction', @@ -32,8 +32,10 @@ const docsInfoConfig: DocsInfoConfig = { web3Wrapper: [docSections.web3Wrapper], types: [docSections.types], }, - sectionNameToMarkdown: { - [docSections.introduction]: IntroMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [docSections.introduction]: IntroMarkdownV1, + }, }, sectionNameToModulePath: { [docSections.web3Wrapper]: ['"web3-wrapper/src/index"'], diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json index d794e159b..1bb2da328 100644 --- a/packages/react-docs/CHANGELOG.json +++ b/packages/react-docs/CHANGELOG.json @@ -1,5 +1,23 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { + "version": "0.0.17", + "changes": [ + { + "note": "Nest MD files under versions so that you can update them for future versions", + "pr": 844 + } + ] + }, + { "timestamp": 1531919263, "version": "0.0.16", "changes": [ diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index 023c63db2..c3853e6ba 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/react-docs", - "version": "0.0.16", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -25,9 +25,9 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/compare-versions": "^3.0.0", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", @@ -36,8 +36,8 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/react-shared": "^0.2.3", - "@0xproject/utils": "^0.7.3", + "@0xproject/react-shared": "^1.0.0", + "@0xproject/utils": "^1.0.0", "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", @@ -52,7 +52,8 @@ "react-dom": "15.6.1", "react-markdown": "^3.2.2", "react-scroll": "^1.5.2", - "react-tooltip": "^3.2.7" + "react-tooltip": "^3.2.7", + "semver": "5.5.0" }, "publishConfig": { "access": "public" diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index a4e6f4f6e..ff33220d2 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -12,6 +12,7 @@ import { import * as _ from 'lodash'; import CircularProgress from 'material-ui/CircularProgress'; import * as React from 'react'; +import * as semver from 'semver'; import { DocsInfo } from '../docs_info'; import { @@ -180,7 +181,20 @@ export class Documentation extends React.Component<DocumentationProps, Documenta return renderedSections; } private _renderSection(typeDefinitionByName: TypeDefinitionByName, sectionName: string): React.ReactNode { - const markdownFileIfExists = this.props.docsInfo.sectionNameToMarkdown[sectionName]; + const markdownVersions = _.keys(this.props.docsInfo.sectionNameToMarkdownByVersion); + const eligibleVersions = _.filter(markdownVersions, mdVersion => { + return semver.lte(mdVersion, this.props.selectedVersion); + }); + if (_.isEmpty(eligibleVersions)) { + throw new Error( + `No eligible markdown sections found for ${this.props.docsInfo.displayName} version ${ + this.props.selectedVersion + }.`, + ); + } + const sortedEligibleVersions = eligibleVersions.sort(semver.rcompare.bind(semver)); + const closestVersion = sortedEligibleVersions[0]; + const markdownFileIfExists = this.props.docsInfo.sectionNameToMarkdownByVersion[closestVersion][sectionName]; if (!_.isUndefined(markdownFileIfExists)) { return ( <MarkdownSection diff --git a/packages/react-docs/src/docs_info.ts b/packages/react-docs/src/docs_info.ts index 5d46dbda6..b37942da6 100644 --- a/packages/react-docs/src/docs_info.ts +++ b/packages/react-docs/src/docs_info.ts @@ -9,6 +9,7 @@ import { DocsInfoTypeConfigs, DocsMenu, DoxityDocObj, + SectionNameToMarkdownByVersion, SectionsMap, SupportedDocJson, TypeDefinitionByName, @@ -24,7 +25,7 @@ export class DocsInfo { public packageUrl: string; public menu: DocsMenu; public sections: SectionsMap; - public sectionNameToMarkdown: { [sectionName: string]: string }; + public sectionNameToMarkdownByVersion: SectionNameToMarkdownByVersion; public contractsByVersionByNetworkId?: ContractsByVersionByNetworkId; public typeConfigs: DocsInfoTypeConfigs; private readonly _docsInfo: DocsInfoConfig; @@ -34,7 +35,7 @@ export class DocsInfo { this.displayName = config.displayName; this.packageUrl = config.packageUrl; this.sections = config.sections; - this.sectionNameToMarkdown = config.sectionNameToMarkdown; + this.sectionNameToMarkdownByVersion = config.sectionNameToMarkdownByVersion; this.contractsByVersionByNetworkId = config.contractsByVersionByNetworkId; this.typeConfigs = config.typeConfigs; this._docsInfo = config; diff --git a/packages/react-docs/src/types.ts b/packages/react-docs/src/types.ts index f4e61edc9..cbc774c2e 100644 --- a/packages/react-docs/src/types.ts +++ b/packages/react-docs/src/types.ts @@ -1,3 +1,7 @@ +export interface SectionNameToMarkdownByVersion { + [version: string]: { [sectionName: string]: string }; +} + export interface DocsInfoConfig { id: string; type: SupportedDocJson; @@ -5,7 +9,7 @@ export interface DocsInfoConfig { packageUrl: string; menu: DocsMenu; sections: SectionsMap; - sectionNameToMarkdown: { [sectionName: string]: string }; + sectionNameToMarkdownByVersion: SectionNameToMarkdownByVersion; visibleConstructors: string[]; sectionNameToModulePath?: { [sectionName: string]: string[] }; menuSubsectionToVersionWhenIntroduced?: { [sectionName: string]: string }; diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json index a96540f10..a1fc76193 100644 --- a/packages/react-shared/CHANGELOG.json +++ b/packages/react-shared/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "timestamp": 1531919263, "version": "0.2.3", "changes": [ diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json index f7cafb9df..008972da9 100644 --- a/packages/react-shared/package.json +++ b/packages/react-shared/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/react-shared", - "version": "0.2.3", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -25,9 +25,9 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index 3633cc5db..762a26a90 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "timestamp": 1531919263, "version": "0.5.4", "changes": [ diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 670dfad2e..99a49e1f2 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-compiler", - "version": "0.5.4", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -53,9 +53,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md", "devDependencies": { - "@0xproject/dev-utils": "^0.4.6", - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/dev-utils": "^1.0.0", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/mkdirp": "^0.5.2", "@types/require-from-string": "^1.2.0", "@types/semver": "^5.5.0", @@ -76,21 +76,21 @@ "zeppelin-solidity": "1.8.0" }, "dependencies": { - "@0xproject/assert": "0.2.13", - "@0xproject/json-schemas": "0.8.3", - "@0xproject/sol-resolver": "^0.0.8", - "@0xproject/types": "^0.8.2", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", + "@0xproject/assert": "^1.0.0", + "@0xproject/json-schemas": "^1.0.0-rc.1", + "@0xproject/sol-resolver": "^1.0.0", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "@types/yargs": "^11.0.0", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "chalk": "^2.3.0", "ethereumjs-util": "^5.1.1", "lodash": "^4.17.4", "mkdirp": "^0.5.1", "require-from-string": "^2.0.1", - "semver": "^5.5.0", + "semver": "5.5.0", "solc": "^0.4.23", "web3-eth-abi": "^1.0.0-beta.24", "yargs": "^10.0.3" diff --git a/packages/sol-cov/CHANGELOG.json b/packages/sol-cov/CHANGELOG.json index 038ba5654..6b7cdf6e9 100644 --- a/packages/sol-cov/CHANGELOG.json +++ b/packages/sol-cov/CHANGELOG.json @@ -1,13 +1,15 @@ [ { - "version": "0.2.0", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { - "note": "Add artifact adapter as a parameter for CoverageSubprovider. Export AbstractArtifactAdapter", + "note": + "Add artifact adapter as a parameter for `CoverageSubprovider`. Export `AbstractArtifactAdapter`", "pr": 589 }, { - "note": "Implement SolCompilerArtifactAdapter and TruffleArtifactAdapter", + "note": "Implement `SolCompilerArtifactAdapter` and `TruffleArtifactAdapter`", "pr": 589 }, { @@ -19,7 +21,7 @@ "pr": 589 }, { - "note": "Fixed a bug causing RegExp to crash if contract code is longer that 32767 characters", + "note": "Fixed a bug causing `RegExp` to crash if contract code is longer that 32767 characters", "pr": 675 }, { @@ -55,11 +57,12 @@ "pr": 675 }, { - "note": "Fix solcVersion regex in parameter validation", + "note": "Fix `solcVersion` regex in parameter validation", "pr": 690 }, { - "note": "Fix a bug when in TruffleArtifactsAdapter causing it to throw if compiler.json is not there", + "note": + "Fix a bug when in `TruffleArtifactsAdapter` causing it to throw if `compiler.json` is not there", "pr": 690 }, { @@ -67,7 +70,7 @@ "pr": 690 }, { - "note": "Create `RevertTraceSubprovider` which prints a stack trace when a REVERT is detected", + "note": "Create `RevertTraceSubprovider` which prints a stack trace when a `REVERT` is detected", "pr": 705 }, { diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index abd70c929..86808bfc1 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-cov", - "version": "0.1.3", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -50,13 +50,13 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md", "dependencies": { - "@0xproject/sol-compiler": "^0.5.4", - "@0xproject/subproviders": "^0.10.6", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", - "@0xproject/dev-utils": "^0.4.6", - "ethereum-types": "^0.0.2", + "@0xproject/sol-compiler": "^1.0.0", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", + "@0xproject/dev-utils": "^1.0.0", + "ethereum-types": "^1.0.0", "ethereumjs-util": "^5.1.1", "glob": "^7.1.2", "istanbul": "^0.4.5", @@ -68,8 +68,8 @@ "solidity-parser-antlr": "^0.2.12" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.1", - "@0xproject/tslint-config": "^0.4.20", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/istanbul": "^0.4.30", "@types/loglevel": "^1.5.3", "@types/mkdirp": "^0.5.1", diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index 1e39c1b39..0be30856e 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -1,6 +1,7 @@ [ { - "version": "0.0.9", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { "note": "Fix a bug in FsResolver where it tries to read directories as files", diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json index f3fd62a2e..48721b612 100644 --- a/packages/sol-resolver/package.json +++ b/packages/sol-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-resolver", - "version": "0.0.8", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -9,7 +9,7 @@ "types": "lib/index.d.ts", "scripts": { "watch_without_deps": "tsc -w", - "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", + "build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib scripts", "lint": "tslint --project .", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/resolver/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", @@ -33,8 +33,8 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^0.8.2", - "@0xproject/typescript-typings": "^0.0.3", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", "lodash": "^4.17.4" }, "publishConfig": { diff --git a/packages/sol-resolver/src/globals.d.ts b/packages/sol-resolver/src/globals.d.ts new file mode 100644 index 000000000..e799b3529 --- /dev/null +++ b/packages/sol-resolver/src/globals.d.ts @@ -0,0 +1,7 @@ +// tslint:disable:completed-docs +declare module '*.json' { + const json: any; + /* tslint:disable */ + export default json; + /* tslint:enable */ +} diff --git a/packages/sol-resolver/src/monorepo_scripts/postpublish.ts b/packages/sol-resolver/src/monorepo_scripts/postpublish.ts new file mode 100644 index 000000000..dcb99d0f7 --- /dev/null +++ b/packages/sol-resolver/src/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/sra-report/CHANGELOG.json b/packages/sra-report/CHANGELOG.json index 7ce8bf0c1..0867f0723 100644 --- a/packages/sra-report/CHANGELOG.json +++ b/packages/sra-report/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "timestamp": 1531919263, "version": "0.1.6", "changes": [ diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json index 77d92f96e..4c62627cb 100644 --- a/packages/sra-report/package.json +++ b/packages/sra-report/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sra-report", - "version": "0.1.6", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -35,21 +35,21 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-report/README.md", "dependencies": { - "@0xproject/assert": "^0.3.0", + "@0xproject/assert": "^1.0.0", "@0xproject/types": "^0.8.2", "@0xproject/order-utils": "^0.0.9", - "@0xproject/connect": "0.6.17", - "@0xproject/json-schemas": "0.8.3", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", + "@0xproject/connect": "^1.0.0", + "@0xproject/json-schemas": "^0.8.3", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", "chalk": "^2.3.0", "lodash": "^4.17.4", "newman": "^3.9.3", "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.48", "@types/nock": "^9.1.2", diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json index 6942aa5db..c91358aad 100644 --- a/packages/subproviders/CHANGELOG.json +++ b/packages/subproviders/CHANGELOG.json @@ -1,9 +1,15 @@ [ { - "version": "0.11.0", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { - "note": "Add `EthLightwalletSubprovider`" + "note": "Add `RpcSubprovider` with timeout", + "pr": 874 + }, + { + "note": "Add `EthLightwalletSubprovider`", + "pr": 775 } ] }, diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index 620a46384..1aa5514a7 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/subproviders", - "version": "0.10.6", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -40,14 +40,14 @@ } }, "dependencies": { - "@0xproject/assert": "^0.3.0", - "@0xproject/types": "^1.0.0", - "@0xproject/web3-wrapper": "^0.7.3", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", + "@0xproject/assert": "^1.0.0", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/web3-wrapper": "^1.0.0", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", "@ledgerhq/hw-app-eth": "^4.3.0", "@ledgerhq/hw-transport-u2f": "^4.3.0", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "bip39": "^2.5.0", "bn.js": "^4.11.8", "eth-lightwallet": "^3.0.1", @@ -61,9 +61,9 @@ "web3-provider-engine": "14.0.6" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", - "@0xproject/utils": "^0.7.3", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", + "@0xproject/utils": "^1.0.0", "@types/bip39": "^2.4.0", "@types/bn.js": "^4.11.0", "@types/hdkey": "^0.7.0", diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index 793819f39..7c3ae70cd 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -19,10 +19,10 @@ "license": "Apache-2.0", "dependencies": { "0x.js": "0.38.5", - "@0xproject/subproviders": "^0.10.6", - "@0xproject/web3-wrapper": "^0.7.3", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", + "@0xproject/subproviders": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", "body-parser": "^1.17.1", "ethereumjs-tx": "^1.3.5", "ethereumjs-util": "^5.1.1", @@ -31,11 +31,11 @@ "rollbar": "^0.6.5" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/tslint-config": "^1.0.0", "@types/body-parser": "^1.16.1", "@types/express": "^4.0.35", "@types/lodash": "4.14.104", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "awesome-typescript-loader": "^3.1.3", "gulp": "^3.9.1", "make-promises-safe": "^1.1.0", diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json index f2a3456f4..fb879f169 100644 --- a/packages/tslint-config/CHANGELOG.json +++ b/packages/tslint-config/CHANGELOG.json @@ -1,5 +1,15 @@ [ { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Added a bunch of rules", + "pr": 883 + } + ] + }, + { "timestamp": 1531149657, "version": "0.4.21", "changes": [ diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index b136b7e4a..92c134f4b 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/tslint-config", - "version": "0.4.21", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -34,7 +34,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/tslint-config/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", + "@0xproject/monorepo-scripts": "^1.0.0", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json index ea3b49c8a..6189acbbc 100644 --- a/packages/types/CHANGELOG.json +++ b/packages/types/CHANGELOG.json @@ -1,9 +1,10 @@ [ { - "version": "1.0.0", + "timestamp": 1532043000, + "version": "1.0.0-rc.1", "changes": [ { - "notes": "Updated types for V2 of 0x protocol" + "note": "Updated types for V2 of 0x protocol" }, { "note": "Add `ECSignatureBuffer`" diff --git a/packages/types/package.json b/packages/types/package.json index fee9d847f..bd3417c44 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/types", - "version": "1.0.0", + "version": "1.0.0-rc.1", "engines": { "node": ">=6.12" }, @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/types/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", "shx": "^0.2.2", @@ -35,7 +35,7 @@ "dependencies": { "@types/node": "^8.0.53", "bignumber.js": "~4.1.0", - "ethereum-types": "^0.0.2" + "ethereum-types": "^1.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index c9dbbc499..5a64d0490 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -1,6 +1,7 @@ [ { - "version": "0.4.4", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { "note": "Add types for `eth-lightwallet`", diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json index ffc09001e..8b7a640c9 100644 --- a/packages/typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/typescript-typings", - "version": "0.4.3", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -25,11 +25,11 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme", "dependencies": { - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "bignumber.js": "~4.1.0" }, "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", + "@0xproject/monorepo-scripts": "^1.0.0", "copyfiles": "^1.2.0", "shx": "^0.2.2" }, diff --git a/packages/typescript-typings/types/lerna-get-packages/index.d.ts b/packages/typescript-typings/types/lerna-get-packages/index.d.ts deleted file mode 100644 index 0650a542c..000000000 --- a/packages/typescript-typings/types/lerna-get-packages/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare interface LernaPackage { - location: string; - package: { - private?: boolean; - version: string; - name: string; - main?: string; - config?: { - additionalTsTypings?: string[]; - }; - }; -} -declare function lernaGetPackages(path: string): LernaPackage[]; -declare module 'lerna-get-packages' { - export = lernaGetPackages; -} diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index d9eb1d3fc..92149a7d4 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,5 +1,24 @@ [ { + "version": "1.0.1", + "changes": [ + { + "note": "Add `AbortController` polyfill to `fetchAsync`", + "pr": 903 + } + ] + }, + { + "timestamp": 1532043000, + "version": "1.0.0", + "changes": [ + { + "note": "Add `fetchAsync` which adds a default timeout to all requests", + "pr": 874 + } + ] + }, + { "timestamp": 1531919263, "version": "0.7.3", "changes": [ diff --git a/packages/utils/package.json b/packages/utils/package.json index 962dca5be..382604fdd 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/utils", - "version": "0.7.3", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -24,8 +24,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "copyfiles": "^1.2.0", "make-promises-safe": "^1.1.0", @@ -35,12 +35,13 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/types": "^1.0.0", - "@0xproject/typescript-typings": "^0.4.3", + "@0xproject/types": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", "@types/node": "^8.0.53", + "abortcontroller-polyfill": "^1.1.9", "bignumber.js": "~4.1.0", "detect-node": "2.0.3", - "ethereum-types": "^0.0.2", + "ethereum-types": "^1.0.0", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", "isomorphic-fetch": "^2.2.1", diff --git a/packages/utils/src/fetchAsync.ts b/packages/utils/src/fetchAsync.ts index c02e5baba..b4c85718d 100644 --- a/packages/utils/src/fetchAsync.ts +++ b/packages/utils/src/fetchAsync.ts @@ -1,5 +1,8 @@ import isNode = require('detect-node'); import 'isomorphic-fetch'; +// WARNING: This needs to be imported after isomorphic-fetch: https://github.com/mo/abortcontroller-polyfill#using-it-on-browsers-without-fetch +// tslint:disable-next-line:ordered-imports +import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'; export const fetchAsync = async ( endpoint: string, diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index 846e8320e..200836a82 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,6 +1,7 @@ [ { - "version": "0.7.3", + "timestamp": 1532043000, + "version": "1.0.0", "changes": [ { "note": "Export `marshaller` utility file.", @@ -9,6 +10,10 @@ { "note": "Add `getNodeTypeAsync` method", "pr": 812 + }, + { + "note": "Stop exporting uniqueVersionIds object", + "pr": 897 } ] }, diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index 13e5d2bcd..d9c577ea9 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/web3-wrapper", - "version": "0.7.3", + "version": "1.0.0", "engines": { "node": ">=6.12" }, @@ -45,8 +45,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.2", - "@0xproject/tslint-config": "^0.4.21", + "@0xproject/monorepo-scripts": "^1.0.0", + "@0xproject/tslint-config": "^1.0.0", "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -64,11 +64,11 @@ "typescript": "2.7.1" }, "dependencies": { - "@0xproject/assert": "0.3.0", - "@0xproject/json-schemas": "^1.0.0", - "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "ethereum-types": "^0.0.2", + "@0xproject/assert": "^1.0.0", + "@0xproject/json-schemas": "^1.0.0-rc.1", + "@0xproject/typescript-typings": "^1.0.0", + "@0xproject/utils": "^1.0.0", + "ethereum-types": "^1.0.0", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", "lodash": "^4.17.4" diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts index 19fe0836c..4433b4b54 100644 --- a/packages/web3-wrapper/src/index.ts +++ b/packages/web3-wrapper/src/index.ts @@ -1,3 +1,3 @@ -export { Web3Wrapper, uniqueVersionIds, NodeType } from './web3_wrapper'; -export { Web3WrapperErrors } from './types'; +export { Web3Wrapper } from './web3_wrapper'; +export { Web3WrapperErrors, NodeType } from './types'; export { marshaller } from './marshaller'; diff --git a/packages/web3-wrapper/src/types.ts b/packages/web3-wrapper/src/types.ts index b7b6bd68a..e81039186 100644 --- a/packages/web3-wrapper/src/types.ts +++ b/packages/web3-wrapper/src/types.ts @@ -57,3 +57,9 @@ export interface TxDataRPC extends CallTxDataBaseRPC { export interface CallDataRPC extends CallTxDataBaseRPC { from?: string; } + +// NodeType represents the type of the backing Ethereum node. +export enum NodeType { + Geth = 'GETH', + Ganache = 'GANACHE', +} diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index e828708f0..4439eb284 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -22,24 +22,18 @@ import { import * as _ from 'lodash'; import { marshaller } from './marshaller'; -import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, Web3WrapperErrors } from './types'; +import { BlockWithoutTransactionDataRPC, BlockWithTransactionDataRPC, NodeType, Web3WrapperErrors } from './types'; import { utils } from './utils'; const BASE_TEN = 10; // These are unique identifiers contained in the response of the // web3_clientVersion call. -export const uniqueVersionIds = { +const uniqueVersionIds = { geth: 'Geth', ganache: 'EthereumJS TestRPC', }; -// NodeType represents the type of the backing Ethereum node. -export enum NodeType { - Geth = 'GETH', - Ganache = 'GANACHE', -} - /** * An alternative to the Web3.js library that provides a consistent, clean, promise-based interface. */ diff --git a/packages/website/md/docs/0xjs/async.md b/packages/website/md/docs/0xjs/1.0.0/async.md index 8abaef331..8abaef331 100644 --- a/packages/website/md/docs/0xjs/async.md +++ b/packages/website/md/docs/0xjs/1.0.0/async.md diff --git a/packages/website/md/docs/0xjs/errors.md b/packages/website/md/docs/0xjs/1.0.0/errors.md index e97973ccf..e97973ccf 100644 --- a/packages/website/md/docs/0xjs/errors.md +++ b/packages/website/md/docs/0xjs/1.0.0/errors.md diff --git a/packages/website/md/docs/0xjs/installation.md b/packages/website/md/docs/0xjs/1.0.0/installation.md index ac0a47699..ac0a47699 100644 --- a/packages/website/md/docs/0xjs/installation.md +++ b/packages/website/md/docs/0xjs/1.0.0/installation.md diff --git a/packages/website/md/docs/0xjs/introduction.md b/packages/website/md/docs/0xjs/1.0.0/introduction.md index 008376d33..008376d33 100644 --- a/packages/website/md/docs/0xjs/introduction.md +++ b/packages/website/md/docs/0xjs/1.0.0/introduction.md diff --git a/packages/website/md/docs/0xjs/versioning.md b/packages/website/md/docs/0xjs/1.0.0/versioning.md index 6bcaa5b4d..6bcaa5b4d 100644 --- a/packages/website/md/docs/0xjs/versioning.md +++ b/packages/website/md/docs/0xjs/1.0.0/versioning.md diff --git a/packages/website/md/docs/0xjs/2.0.0/introduction.md b/packages/website/md/docs/0xjs/2.0.0/introduction.md new file mode 100644 index 000000000..b98aeef38 --- /dev/null +++ b/packages/website/md/docs/0xjs/2.0.0/introduction.md @@ -0,0 +1,3 @@ +<b>**NOTE:** Release candidate versions are meant to work with V2 of 0x protocol. To interact with V1, select a 0.X version.</b> + +Welcome to the [0x.js](https://github.com/0xProject/0x-monorepo) documentation! 0x.js is a Javascript library for interacting with the 0x protocol. With it, you can easily make calls to the 0x smart contracts as well as any token adhering to the token standards supported by the protocol (currently ERC20 & ERC721). Functionality includes generating, signing, filling and cancelling orders, verifying an orders signature, setting or checking a users ERC20/ERC721 token balance/allowance and much more. diff --git a/packages/website/md/docs/0xjs/2.0.0/versioning.md b/packages/website/md/docs/0xjs/2.0.0/versioning.md new file mode 100644 index 000000000..7f2b6fee9 --- /dev/null +++ b/packages/website/md/docs/0xjs/2.0.0/versioning.md @@ -0,0 +1 @@ +Since v1.0.0, this package adheres to the [Semantic Versioning 2.0.0](http://semver.org/) specification. The library's public interface includes all the methods, properties and types included in the documentation. We will publish with a major version bump for any breaking change to the public interface, use a minor version bump when introducing new features in a backwards-compatible way, and patch versions when introducing backwards-compatible bug fixes. Because of this, we recommend you import `0x.js` with a caret `^2.0.0` to take advantage of non-breaking bug fixes. diff --git a/packages/website/md/docs/connect/installation.md b/packages/website/md/docs/connect/1.0.0/installation.md index 950bf92ca..950bf92ca 100644 --- a/packages/website/md/docs/connect/installation.md +++ b/packages/website/md/docs/connect/1.0.0/installation.md diff --git a/packages/website/md/docs/connect/introduction.md b/packages/website/md/docs/connect/1.0.0/introduction.md index 4e3039442..4e3039442 100644 --- a/packages/website/md/docs/connect/introduction.md +++ b/packages/website/md/docs/connect/1.0.0/introduction.md diff --git a/packages/website/md/docs/json_schemas/installation.md b/packages/website/md/docs/json_schemas/1.0.0/installation.md index 50a37bae1..50a37bae1 100644 --- a/packages/website/md/docs/json_schemas/installation.md +++ b/packages/website/md/docs/json_schemas/1.0.0/installation.md diff --git a/packages/website/md/docs/json_schemas/introduction.md b/packages/website/md/docs/json_schemas/1.0.0/introduction.md index a27f4b521..cc777b1a8 100644 --- a/packages/website/md/docs/json_schemas/introduction.md +++ b/packages/website/md/docs/json_schemas/1.0.0/introduction.md @@ -1,3 +1,5 @@ +<b>**NOTE:** Release candidate versions are meant to work with V2 of 0x protocol. To interact with V1, select a 0.X version.</b> + Welcome to the [@0xproject/json-schemas](https://github.com/0xProject/0x-monorepo/tree/development/packages/json-schemas) documentation! This package provides JSON schemas for validating 0x Protocol & Standard Relayer API data structures. It provides both the raw JSON schemas and a schema validator class to interact with them from a JS project. If you are not using a Javascript-based language for your project, you can copy-paste the JSON schemas within this package and use them together with a [JSON Schema](http://json-schema.org/) implementation in your [language of choice](http://json-schema.org/implementations.html) (e.g Python, Haskell, Go, C, C++, Rust, Ruby, Scala, etc...). diff --git a/packages/website/md/docs/json_schemas/schemas.md b/packages/website/md/docs/json_schemas/1.0.0/schemas.md index fcf5d8df6..fcf5d8df6 100644 --- a/packages/website/md/docs/json_schemas/schemas.md +++ b/packages/website/md/docs/json_schemas/1.0.0/schemas.md diff --git a/packages/website/md/docs/json_schemas/usage.md b/packages/website/md/docs/json_schemas/1.0.0/usage.md index 68b801153..68b801153 100644 --- a/packages/website/md/docs/json_schemas/usage.md +++ b/packages/website/md/docs/json_schemas/1.0.0/usage.md diff --git a/packages/website/md/docs/order_utils/installation.md b/packages/website/md/docs/order_utils/1.0.0/installation.md index 68a7cf960..68a7cf960 100644 --- a/packages/website/md/docs/order_utils/installation.md +++ b/packages/website/md/docs/order_utils/1.0.0/installation.md diff --git a/packages/website/md/docs/order_utils/introduction.md b/packages/website/md/docs/order_utils/1.0.0/introduction.md index d5f3f2925..d5f3f2925 100644 --- a/packages/website/md/docs/order_utils/introduction.md +++ b/packages/website/md/docs/order_utils/1.0.0/introduction.md diff --git a/packages/website/md/docs/smart_contracts/introduction.md b/packages/website/md/docs/smart_contracts/1.0.0/introduction.md index 566a573b6..566a573b6 100644 --- a/packages/website/md/docs/smart_contracts/introduction.md +++ b/packages/website/md/docs/smart_contracts/1.0.0/introduction.md diff --git a/packages/website/md/docs/sol_cov/usage.md b/packages/website/md/docs/sol_cov/usage.md index 433cfad96..c747005fb 100644 --- a/packages/website/md/docs/sol_cov/usage.md +++ b/packages/website/md/docs/sol_cov/usage.md @@ -8,7 +8,7 @@ In order to use `CoverageSubprovider` with your favorite framework you need to p ### Sol-compiler -If you are generating your artifacts with [@0xproject/sol-compiler](LINK) you can use the `SolCompilerArtifactsAdapter` we've implemented for you. +If you are generating your artifacts with [@0xproject/sol-compiler](https://0xproject.com/docs/sol-compiler) you can use the `SolCompilerArtifactsAdapter` we've implemented for you. ```typescript import { SolCompilerArtifactsAdapter } from '@0xproject/sol-cov'; @@ -19,7 +19,7 @@ const artifactsAdapter = new SolCompilerArtifactsAdapter(artifactsPath, contract ### Truffle -If your project is using [Truffle](LINK), we've written a `TruffleArtifactsAdapter`for you. +If your project is using [Truffle](https://truffleframework.com/), we've written a `TruffleArtifactsAdapter`for you. ```typescript import { TruffleArtifactAdapter } from '@0xproject/sol-cov'; diff --git a/packages/website/package.json b/packages/website/package.json index 4cefa19a9..99fd7cff3 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -7,7 +7,7 @@ "private": true, "description": "Website and 0x portal dapp", "scripts": { - "build": "NODE_ENV=production webpack; exit 0;", + "build": "NODE_ENV=production node --max_old_space_size=8192 ../../node_modules/.bin/webpack; exit 0;", "clean": "shx rm -f public/bundle*", "lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'", "watch_without_deps": "webpack-dev-server --content-base public --https", @@ -23,13 +23,13 @@ "dependencies": { "@0xproject/contract-wrappers": "^0.0.5", "@0xproject/order-utils": "^0.0.9", - "@0xproject/react-docs": "^0.0.16", + "@0xproject/react-docs": "^1.0.0", "@0xproject/react-shared": "^0.2.3", - "@0xproject/subproviders": "^0.10.6", + "@0xproject/subproviders": "^1.0.0", "@0xproject/types": "^0.8.1", "@0xproject/typescript-typings": "^0.4.3", - "@0xproject/utils": "^0.7.3", - "@0xproject/web3-wrapper": "^0.7.3", + "@0xproject/utils": "^1.0.0", + "@0xproject/web3-wrapper": "^1.0.0", "accounting": "^0.4.1", "basscss": "^8.0.3", "blockies": "^0.0.2", diff --git a/packages/website/ts/containers/connect_documentation.ts b/packages/website/ts/containers/connect_documentation.ts index f939ef0df..abf419347 100644 --- a/packages/website/ts/containers/connect_documentation.ts +++ b/packages/website/ts/containers/connect_documentation.ts @@ -10,8 +10,8 @@ import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/connect/introduction'); -const InstallationMarkdown = require('md/docs/connect/installation'); +const IntroMarkdownV1 = require('md/docs/connect/1.0.0/introduction'); +const InstallationMarkdownV1 = require('md/docs/connect/1.0.0/installation'); /* tslint:enable:no-var-requires */ const connectDocSections = { @@ -34,9 +34,11 @@ const docsInfoConfig: DocsInfoConfig = { webSocketOrderbookChannel: [connectDocSections.webSocketOrderbookChannel], types: [connectDocSections.types], }, - sectionNameToMarkdown: { - [connectDocSections.introduction]: IntroMarkdown, - [connectDocSections.installation]: InstallationMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [connectDocSections.introduction]: IntroMarkdownV1, + [connectDocSections.installation]: InstallationMarkdownV1, + }, }, sectionNameToModulePath: { [connectDocSections.httpClient]: ['"src/http_client"'], diff --git a/packages/website/ts/containers/ethereum_types_documentation.ts b/packages/website/ts/containers/ethereum_types_documentation.ts index 285438835..0be8dd3bc 100644 --- a/packages/website/ts/containers/ethereum_types_documentation.ts +++ b/packages/website/ts/containers/ethereum_types_documentation.ts @@ -30,9 +30,11 @@ const docsInfoConfig: DocsInfoConfig = { install: [docSections.installation], types: [docSections.types], }, - sectionNameToMarkdown: { - [docSections.introduction]: IntroMarkdown, - [docSections.installation]: InstallationMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [docSections.introduction]: IntroMarkdown, + [docSections.installation]: InstallationMarkdown, + }, }, sectionNameToModulePath: { [docSections.types]: ['"index"'], diff --git a/packages/website/ts/containers/json_schemas_documentation.ts b/packages/website/ts/containers/json_schemas_documentation.ts index 67740d4c6..523777114 100644 --- a/packages/website/ts/containers/json_schemas_documentation.ts +++ b/packages/website/ts/containers/json_schemas_documentation.ts @@ -9,10 +9,10 @@ import { DocPackages } from 'ts/types'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/json_schemas/introduction'); -const InstallationMarkdown = require('md/docs/json_schemas/installation'); -const UsageMarkdown = require('md/docs/json_schemas/usage'); -const SchemasMarkdown = require('md/docs/json_schemas/schemas'); +const IntroMarkdownV1 = require('md/docs/json_schemas/1.0.0/introduction'); +const InstallationMarkdownV1 = require('md/docs/json_schemas/1.0.0/installation'); +const UsageMarkdownV1 = require('md/docs/json_schemas/1.0.0/usage'); +const SchemasMarkdownV1 = require('md/docs/json_schemas/1.0.0/schemas'); /* tslint:enable:no-var-requires */ const docSections = { @@ -35,11 +35,13 @@ const docsInfoConfig: DocsInfoConfig = { schemaValidator: [docSections.schemaValidator], schemas: [docSections.schemas], }, - sectionNameToMarkdown: { - [docSections.introduction]: IntroMarkdown, - [docSections.installation]: InstallationMarkdown, - [docSections.schemas]: SchemasMarkdown, - [docSections.usage]: UsageMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [docSections.introduction]: IntroMarkdownV1, + [docSections.installation]: InstallationMarkdownV1, + [docSections.schemas]: SchemasMarkdownV1, + [docSections.usage]: UsageMarkdownV1, + }, }, sectionNameToModulePath: { [docSections.schemaValidator]: ['"json-schemas/src/schema_validator"'], diff --git a/packages/website/ts/containers/order_utils_documentation.ts b/packages/website/ts/containers/order_utils_documentation.ts index 37b7f2273..c6570f514 100644 --- a/packages/website/ts/containers/order_utils_documentation.ts +++ b/packages/website/ts/containers/order_utils_documentation.ts @@ -10,8 +10,8 @@ import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/order_utils/introduction'); -const InstallationMarkdown = require('md/docs/order_utils/installation'); +const IntroMarkdownV1 = require('md/docs/order_utils/1.0.0/introduction'); +const InstallationMarkdownV1 = require('md/docs/order_utils/1.0.0/installation'); /* tslint:enable:no-var-requires */ const docSections = { @@ -32,9 +32,11 @@ const docsInfoConfig: DocsInfoConfig = { usage: [docSections.usage], types: [docSections.types], }, - sectionNameToMarkdown: { - [docSections.introduction]: IntroMarkdown, - [docSections.installation]: InstallationMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [docSections.introduction]: IntroMarkdownV1, + [docSections.installation]: InstallationMarkdownV1, + }, }, sectionNameToModulePath: { [docSections.usage]: [ diff --git a/packages/website/ts/containers/smart_contracts_documentation.ts b/packages/website/ts/containers/smart_contracts_documentation.ts index c88c3b365..b0a712477 100644 --- a/packages/website/ts/containers/smart_contracts_documentation.ts +++ b/packages/website/ts/containers/smart_contracts_documentation.ts @@ -10,7 +10,7 @@ import { DocPackages, SmartContractDocSections as Sections } from 'ts/types'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/smart_contracts/introduction'); +const IntroMarkdownV1 = require('md/docs/smart_contracts/1.0.0/introduction'); /* tslint:enable:no-var-requires */ const docsInfoConfig: DocsInfoConfig = { @@ -22,8 +22,10 @@ const docsInfoConfig: DocsInfoConfig = { introduction: [Sections.Introduction], contracts: [Sections.Exchange, Sections.TokenRegistry, Sections.ZRXToken, Sections.TokenTransferProxy], }, - sectionNameToMarkdown: { - [Sections.Introduction]: IntroMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [Sections.Introduction]: IntroMarkdownV1, + }, }, sections: { Introduction: Sections.Introduction, diff --git a/packages/website/ts/containers/sol_compiler_documentation.ts b/packages/website/ts/containers/sol_compiler_documentation.ts index 8720e2c1d..b289c8f34 100644 --- a/packages/website/ts/containers/sol_compiler_documentation.ts +++ b/packages/website/ts/containers/sol_compiler_documentation.ts @@ -9,8 +9,8 @@ import { DocPackages } from 'ts/types'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/sol-compiler/introduction'); -const InstallationMarkdown = require('md/docs/sol-compiler/installation'); +const IntroMarkdownV1 = require('md/docs/sol-compiler/introduction'); +const InstallationMarkdownV1 = require('md/docs/sol-compiler/installation'); const UsageMarkdown = require('md/docs/sol-compiler/usage'); /* tslint:enable:no-var-requires */ @@ -34,10 +34,12 @@ const docsInfoConfig: DocsInfoConfig = { compiler: [docSections.compiler], types: [docSections.types], }, - sectionNameToMarkdown: { - [docSections.introduction]: IntroMarkdown, - [docSections.installation]: InstallationMarkdown, - [docSections.usage]: UsageMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [docSections.introduction]: IntroMarkdownV1, + [docSections.installation]: InstallationMarkdownV1, + [docSections.usage]: UsageMarkdown, + }, }, sectionNameToModulePath: { [docSections.compiler]: ['"sol-compiler/src/compiler"'], diff --git a/packages/website/ts/containers/sol_cov_documentation.ts b/packages/website/ts/containers/sol_cov_documentation.ts index a8009071f..d78c450ed 100644 --- a/packages/website/ts/containers/sol_cov_documentation.ts +++ b/packages/website/ts/containers/sol_cov_documentation.ts @@ -9,8 +9,8 @@ import { DocPackages } from 'ts/types'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/sol_cov/introduction'); -const InstallationMarkdown = require('md/docs/sol_cov/installation'); +const IntroMarkdownV1 = require('md/docs/sol_cov/introduction'); +const InstallationMarkdownV1 = require('md/docs/sol_cov/installation'); const UsageMarkdown = require('md/docs/sol_cov/usage'); /* tslint:enable:no-var-requires */ @@ -40,10 +40,12 @@ const docsInfoConfig: DocsInfoConfig = { 'truffle-artifact-adapter': [docSections.truffleArtifactAdapter], types: [docSections.types], }, - sectionNameToMarkdown: { - [docSections.introduction]: IntroMarkdown, - [docSections.installation]: InstallationMarkdown, - [docSections.usage]: UsageMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [docSections.introduction]: IntroMarkdownV1, + [docSections.installation]: InstallationMarkdownV1, + [docSections.usage]: UsageMarkdown, + }, }, sectionNameToModulePath: { [docSections.coverageSubprovider]: ['"sol-cov/src/coverage_subprovider"'], diff --git a/packages/website/ts/containers/subproviders_documentation.ts b/packages/website/ts/containers/subproviders_documentation.ts index 567f6a37e..0e9150d7b 100644 --- a/packages/website/ts/containers/subproviders_documentation.ts +++ b/packages/website/ts/containers/subproviders_documentation.ts @@ -10,8 +10,8 @@ import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/subproviders/introduction'); -const InstallationMarkdown = require('md/docs/subproviders/installation'); +const IntroMarkdownV1 = require('md/docs/subproviders/introduction'); +const InstallationMarkdownV1 = require('md/docs/subproviders/installation'); const LedgerNodeHidMarkdown = require('md/docs/subproviders/ledger_node_hid'); /* tslint:enable:no-var-requires */ @@ -57,10 +57,12 @@ const docsInfoConfig: DocsInfoConfig = { ['nonceTracker-subprovider']: [docSections.nonceTrackerSubprovider], types: [docSections.types], }, - sectionNameToMarkdown: { - [docSections.introduction]: IntroMarkdown, - [docSections.installation]: InstallationMarkdown, - [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [docSections.introduction]: IntroMarkdownV1, + [docSections.installation]: InstallationMarkdownV1, + [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown, + }, }, sectionNameToModulePath: { [docSections.subprovider]: ['"subproviders/src/subproviders/subprovider"'], diff --git a/packages/website/ts/containers/web3_wrapper_documentation.ts b/packages/website/ts/containers/web3_wrapper_documentation.ts index b04a83ac4..8d98d9476 100644 --- a/packages/website/ts/containers/web3_wrapper_documentation.ts +++ b/packages/website/ts/containers/web3_wrapper_documentation.ts @@ -10,8 +10,8 @@ import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/web3_wrapper/introduction'); -const InstallationMarkdown = require('md/docs/web3_wrapper/installation'); +const IntroMarkdownV1 = require('md/docs/web3_wrapper/introduction'); +const InstallationMarkdownV1 = require('md/docs/web3_wrapper/installation'); /* tslint:enable:no-var-requires */ const docSections = { @@ -32,9 +32,11 @@ const docsInfoConfig: DocsInfoConfig = { web3Wrapper: [docSections.web3Wrapper], types: [docSections.types], }, - sectionNameToMarkdown: { - [docSections.introduction]: IntroMarkdown, - [docSections.installation]: InstallationMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [docSections.introduction]: IntroMarkdownV1, + [docSections.installation]: InstallationMarkdownV1, + }, }, sectionNameToModulePath: { [docSections.web3Wrapper]: ['"web3-wrapper/src/web3_wrapper"'], diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts index 9d3be56f5..6be54595d 100644 --- a/packages/website/ts/containers/zero_ex_js_documentation.ts +++ b/packages/website/ts/containers/zero_ex_js_documentation.ts @@ -10,11 +10,14 @@ import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; /* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/0xjs/introduction'); -const InstallationMarkdown = require('md/docs/0xjs/installation'); -const AsyncMarkdown = require('md/docs/0xjs/async'); -const ErrorsMarkdown = require('md/docs/0xjs/errors'); -const versioningMarkdown = require('md/docs/0xjs/versioning'); +const IntroMarkdownV1 = require('md/docs/0xjs/1.0.0/introduction'); +const InstallationMarkdownV1 = require('md/docs/0xjs/1.0.0/installation'); +const AsyncMarkdownV1 = require('md/docs/0xjs/1.0.0/async'); +const ErrorsMarkdownV1 = require('md/docs/0xjs/1.0.0/errors'); +const versioningMarkdownV1 = require('md/docs/0xjs/1.0.0/versioning'); + +const IntroMarkdownV2 = require('md/docs/0xjs/2.0.0/introduction'); +const versioningMarkdownV2 = require('md/docs/0xjs/2.0.0/versioning'); /* tslint:enable:no-var-requires */ const zeroExJsDocSections = { @@ -54,12 +57,22 @@ const docsInfoConfig: DocsInfoConfig = { orderWatcher: [zeroExJsDocSections.orderWatcher], types: [zeroExJsDocSections.types], }, - sectionNameToMarkdown: { - [zeroExJsDocSections.introduction]: IntroMarkdown, - [zeroExJsDocSections.installation]: InstallationMarkdown, - [zeroExJsDocSections.async]: AsyncMarkdown, - [zeroExJsDocSections.errors]: ErrorsMarkdown, - [zeroExJsDocSections.versioning]: versioningMarkdown, + sectionNameToMarkdownByVersion: { + '0.0.1': { + [zeroExJsDocSections.introduction]: IntroMarkdownV1, + [zeroExJsDocSections.installation]: InstallationMarkdownV1, + [zeroExJsDocSections.async]: AsyncMarkdownV1, + [zeroExJsDocSections.errors]: ErrorsMarkdownV1, + [zeroExJsDocSections.versioning]: versioningMarkdownV1, + }, + '1.0.0-rc.1': { + [zeroExJsDocSections.introduction]: IntroMarkdownV2, + [zeroExJsDocSections.versioning]: versioningMarkdownV2, + // These are the same as for V1 + [zeroExJsDocSections.installation]: InstallationMarkdownV1, + [zeroExJsDocSections.async]: AsyncMarkdownV1, + [zeroExJsDocSections.errors]: ErrorsMarkdownV1, + }, }, sectionNameToModulePath: { [zeroExJsDocSections.zeroEx]: ['"0x.js/src/0x"', '"src/0x"'], diff --git a/packages/website/ts/utils/doc_utils.ts b/packages/website/ts/utils/doc_utils.ts index 1627b9b0c..b9084bba7 100644 --- a/packages/website/ts/utils/doc_utils.ts +++ b/packages/website/ts/utils/doc_utils.ts @@ -1,6 +1,5 @@ import { DoxityDocObj, TypeDocNode } from '@0xproject/react-docs'; import { fetchAsync, logUtils } from '@0xproject/utils'; -import findVersions = require('find-versions'); import * as _ from 'lodash'; import { S3FileObject, VersionToFilePath } from 'ts/types'; import convert = require('xml-js'); @@ -10,7 +9,7 @@ export const docUtils = { const versionFilePaths = await docUtils.getVersionFileNamesAsync(s3DocJsonRoot, folderName); const versionToFilePath: VersionToFilePath = {}; _.each(versionFilePaths, filePath => { - const [version] = findVersions(filePath); + const version = filePath.split('/v')[1].replace('.json', ''); versionToFilePath[version] = filePath; }); return versionToFilePath; |