From f4a2e227e1a7224fbbe9c99d9aa033d176a9c4de Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 29 Jul 2018 21:58:39 +0200 Subject: Remove all in-package monorepo-scripts by adding doc gen/upload and aggregate release note publishing to publish script --- packages/order-watcher/package.json | 8 +++----- packages/order-watcher/src/monorepo_scripts/postpublish.ts | 8 -------- 2 files changed, 3 insertions(+), 13 deletions(-) delete mode 100644 packages/order-watcher/src/monorepo_scripts/postpublish.ts (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index e4226f017..2b7507f02 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -13,7 +13,7 @@ "types": "lib/src/index.d.ts", "scripts": { "watch_without_deps": "yarn pre_build && tsc -w", - "build": "yarn pre_build && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", + "build": "yarn pre_build && tsc", "pre_build": "run-s update_artifacts copy_artifacts generate_contract_wrappers", "lint": "tslint --project . --exclude **/src/generated_contract_wrappers/**/*", "generate_contract_wrappers": "abi-gen --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers", @@ -24,9 +24,8 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts", "update_artifacts": "for i in ${npm_package_config_contracts_v2_beta}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-beta-testnet/$i.json src/artifacts; done;", - "clean": "shx rm -rf _bundles lib test_temp scripts test/artifacts src/generated_contract_wrappers", - "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" + "clean": "shx rm -rf _bundles lib test_temp test/artifacts src/generated_contract_wrappers", + "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" }, "config": { "contracts_v2_beta": "Exchange WETH9 ERC20Token ERC721Token" @@ -43,7 +42,6 @@ "@0xproject/abi-gen": "^1.0.4", "@0xproject/dev-utils": "^1.0.3", "@0xproject/migrations": "^1.0.3", - "@0xproject/monorepo-scripts": "^1.0.4", "@0xproject/sol-compiler": "^1.0.4", "@0xproject/tslint-config": "^1.0.4", "@types/bintrees": "^1.0.2", diff --git a/packages/order-watcher/src/monorepo_scripts/postpublish.ts b/packages/order-watcher/src/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/order-watcher/src/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); -- cgit From 6dd656bdfc5e9878a8a6e332b4ea844556f75d56 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 3 Aug 2018 11:14:01 +0200 Subject: Add OrderWatcher docs page --- packages/order-watcher/package.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 2b7507f02..917998739 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -25,10 +25,15 @@ "copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts", "update_artifacts": "for i in ${npm_package_config_contracts_v2_beta}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-beta-testnet/$i.json src/artifacts; done;", "clean": "shx rm -rf _bundles lib test_temp test/artifacts src/generated_contract_wrappers", - "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" + "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", + "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { - "contracts_v2_beta": "Exchange WETH9 ERC20Token ERC721Token" + "contracts_v2_beta": "Exchange WETH9 ERC20Token ERC721Token", + "postpublish": { + "assets": [], + "shouldPublishDocs": true + } }, "repository": { "type": "git", -- cgit From d85ce6ac758a9a726c298b972a7c557e01f2ab2f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 3 Aug 2018 17:15:14 +0200 Subject: Make signature_util into an object literal so related functions are rendered together in the docs --- packages/order-watcher/src/utils/assert.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/src/utils/assert.ts b/packages/order-watcher/src/utils/assert.ts index a891a60d2..e4a1e2c7b 100644 --- a/packages/order-watcher/src/utils/assert.ts +++ b/packages/order-watcher/src/utils/assert.ts @@ -7,7 +7,7 @@ import { BigNumber } from '@0xproject/utils'; // tslint:enable:no-unused-variable import { Provider } from 'ethereum-types'; -import { isValidSignatureAsync } from '@0xproject/order-utils'; +import { signatureUtils } from '@0xproject/order-utils'; export const assert = { ...sharedAssert, @@ -17,7 +17,7 @@ export const assert = { signature: string, signerAddress: string, ): Promise { - const isValid = await isValidSignatureAsync(provider, orderHash, signature, signerAddress); + const isValid = await signatureUtils.isValidSignatureAsync(provider, orderHash, signature, signerAddress); assert.assert(isValid, `Expected order with hash '${orderHash}' to have a valid signature`); }, }; -- cgit From 30be039570d6a533a339c47d068e3d4ef0f4c92a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 3 Aug 2018 22:24:42 +0200 Subject: Add missing comments --- packages/order-watcher/src/order_watcher/order_watcher.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index e2d6fc270..d4c5cca4b 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -87,6 +87,12 @@ export class OrderWatcher { private readonly _cleanupJobInterval: number; private _cleanupJobIntervalIdIfExists?: NodeJS.Timer; private _callbackIfExists?: OnOrderStateChangeCallback; + /** + * Instantiate a new OrderWatcher + * @param provider Web3 provider to use for JSON RPC calls + * @param networkId NetworkId to watch orders on + * @param partialConfig Optional configurations + */ constructor( provider: Provider, networkId: number, -- cgit From ad9bb3ea59bcedb420830e23f5a9874475c86016 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 21 Aug 2018 17:16:24 +0100 Subject: Fix order-watcher index.ts --- packages/order-watcher/src/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/src/index.ts b/packages/order-watcher/src/index.ts index 5f84554c8..8efca6217 100644 --- a/packages/order-watcher/src/index.ts +++ b/packages/order-watcher/src/index.ts @@ -1,8 +1,14 @@ export { OrderWatcher } from './order_watcher/order_watcher'; -export { OrderStateValid, OrderStateInvalid, OrderState } from '@0xproject/types'; +export { + OrderStateValid, + OrderStateInvalid, + OrderState, + ExchangeContractErrs, + OrderRelevantState, +} from '@0xproject/types'; export { OnOrderStateChangeCallback, OrderWatcherConfig } from './types'; -export { Order, SignedOrder } from '@0xproject/types'; -export { BlockParamLiteral, BlockParam, Provider } from 'ethereum-types'; +export { SignedOrder } from '@0xproject/types'; +export { JSONRPCRequestPayload, JSONRPCErrorCallback, Provider, JSONRPCResponsePayload } from 'ethereum-types'; -- cgit From 1bbd7bf870730dfe2146819e3740522990eb83ca Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 21 Aug 2018 23:20:01 +0100 Subject: Add generated_docs dir to clean command --- packages/order-watcher/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 4d719e575..073c25615 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -24,7 +24,7 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts", "update_artifacts": "for i in ${npm_package_config_contracts_v2_beta}; do copyfiles -u 4 ../migrations/artifacts/2.0.0-beta-testnet/$i.json src/artifacts; done;", - "clean": "shx rm -rf _bundles lib test_temp test/artifacts src/generated_contract_wrappers", + "clean": "shx rm -rf _bundles lib test_temp test/artifacts src/generated_contract_wrappers generated_docs", "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", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES" }, -- cgit From 301cb296ec77e8af5c1722679e04cb983c848153 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 21 Aug 2018 23:58:06 +0100 Subject: Move types from sol-compiler to types so they can be used in other places without requiring sol-compiler as a dep --- packages/order-watcher/package.json | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 073c25615..1765d7cad 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -47,7 +47,6 @@ "@0xproject/abi-gen": "^1.0.5", "@0xproject/dev-utils": "^1.0.4", "@0xproject/migrations": "^1.0.4", - "@0xproject/sol-compiler": "^1.0.5", "@0xproject/tslint-config": "^1.0.5", "@types/bintrees": "^1.0.2", "@types/lodash": "4.14.104", -- cgit From d907b403788576c7d4fe51090a561f1e951126e2 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 22 Aug 2018 13:12:42 +0100 Subject: Fix remaining merge issues --- packages/order-watcher/src/artifacts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/src/artifacts.ts b/packages/order-watcher/src/artifacts.ts index d47e619c2..520066a24 100644 --- a/packages/order-watcher/src/artifacts.ts +++ b/packages/order-watcher/src/artifacts.ts @@ -1,4 +1,4 @@ -import { ContractArtifact } from '@0xproject/sol-compiler'; +import { ContractArtifact } from 'ethereum-types'; import * as ERC20Token from './artifacts/ERC20Token.json'; import * as ERC721Token from './artifacts/ERC721Token.json'; -- cgit From 40b202f8c0907cb729cc0d7d755a6810c8b1ff06 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 22 Aug 2018 15:53:19 +0100 Subject: Update all CHANGELOGs --- packages/order-watcher/CHANGELOG.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 6a365f314..ee6d5540a 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,4 +1,18 @@ [ + { + "version": "1.0.1-rc.4", + "changes": [ + { + "note": + "Export types: `ExchangeContractErrs`, `OrderRelevantState`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", + "pr": 924 + }, + { + "note": "Remove exporting types: `BlockParamLiteral`, `BlockParam`, `Order`", + "pr": 924 + } + ] + }, { "version": "1.0.1-rc.3", "changes": [ -- cgit From 69b436babee4959a0bb6b5c78e3ea26e2a2f9720 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 22 Aug 2018 23:13:59 +0100 Subject: Refactor publish script so that root package.json configs.packagesWithDocs is canonical source of which packages have doc pages --- packages/order-watcher/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 37a1c20e4..121f3f3f4 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -31,8 +31,7 @@ "config": { "contracts_v2_beta": "AssetProxyOwner ERC20Proxy ERC20Token ERC721Proxy ERC721Token Exchange Forwarder OrderValidator WETH9 ZRXToken", "postpublish": { - "assets": [], - "shouldPublishDocs": true + "assets": [] } }, "repository": { -- cgit