Compare commits
80 Commits
ewong_prot
...
@0xproject
Author | SHA1 | Date | |
---|---|---|---|
|
dfeea78615 | ||
|
c8b93adcd0 | ||
|
2b02ddc588 | ||
|
80c7c23151 | ||
|
c068b574e5 | ||
|
9a20d4e1c9 | ||
|
cca471a1ce | ||
|
66d63e8f4f | ||
|
e678fed55b | ||
|
9b10349b7c | ||
|
48838e1e98 | ||
|
eafd666ecd | ||
|
599554b785 | ||
|
d57d282cab | ||
|
562bef98e2 | ||
|
900f819be8 | ||
|
e7337c2451 | ||
|
dc81193132 | ||
|
fa868b4963 | ||
|
62945ad363 | ||
|
61c38d35be | ||
|
4e0ec72896 | ||
|
c28289e9a8 | ||
|
e7e9ddf232 | ||
|
f03784ba37 | ||
|
2445e23c0b | ||
|
cd29483187 | ||
|
9bacbdab48 | ||
|
551d484fb7 | ||
|
ff66432b83 | ||
|
a7ae82a2d1 | ||
|
5f34b5a80e | ||
|
8fca2a8116 | ||
|
5472500119 | ||
|
8fb5c29b4b | ||
|
40a061a5ca | ||
|
2ef82592a3 | ||
|
14b5448d70 | ||
|
e7d45e47bf | ||
|
28268d4355 | ||
|
50fa02c1d1 | ||
|
b36ff9103d | ||
|
f032c2466c | ||
|
b63ddc9be4 | ||
|
171430b617 | ||
|
d561043774 | ||
|
b1871e9ddd | ||
|
b4a5e7258c | ||
|
3c75debdf9 | ||
|
84d1053f73 | ||
|
f9df42f5d9 | ||
|
4414ef0a0f | ||
|
b7729ada38 | ||
|
3da67feeb2 | ||
|
8a0d563a32 | ||
|
612fc4a949 | ||
|
bf915ce403 | ||
|
0f9ea9773e | ||
|
447a3a6c26 | ||
|
f1cc16c44d | ||
|
aae16b6343 | ||
|
834e1538d1 | ||
|
afc489bc2c | ||
|
3e061e7364 | ||
|
6395c2a8b2 | ||
|
c8225288cd | ||
|
4a108aa67d | ||
|
fd9b3e0dcf | ||
|
f94b647e61 | ||
|
2eccc3efaf | ||
|
972341725e | ||
|
40b10fd29d | ||
|
b31fcffc76 | ||
|
ec222ea0cd | ||
|
5533220da0 | ||
|
6ee7024457 | ||
|
f839ac9c58 | ||
|
1a8b1460a6 | ||
|
feac0779a4 | ||
|
d9eeb0421c |
@@ -3,7 +3,7 @@ version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
environment:
|
||||
CONTRACTS_COMMIT_HASH: '9ed05f5'
|
||||
working_directory: ~/repo
|
||||
@@ -11,12 +11,12 @@ jobs:
|
||||
- checkout
|
||||
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
|
||||
- restore_cache:
|
||||
key: dependency-cache-{{ checksum "package.json" }}
|
||||
key: dependency-cache-v1-{{ checksum "package.json" }}
|
||||
- run:
|
||||
name: yarn
|
||||
command: yarn --frozen-lockfile
|
||||
- save_cache:
|
||||
key: dependency-cache-{{ checksum "package.json" }}
|
||||
key: dependency-cache-v1-{{ checksum "package.json" }}
|
||||
paths:
|
||||
- ./node_modules
|
||||
- run: wget https://s3.amazonaws.com/testrpc-shapshots/${CONTRACTS_COMMIT_HASH}.zip
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
- ~/repo
|
||||
test-installation:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
- run: yarn test:installation
|
||||
test-0xjs:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
- ~/repo/packages/0x.js/coverage/lcov.info
|
||||
test-contracts:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
- ~/repo/packages/contracts/coverage/lcov.info
|
||||
test-sol-compiler:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -89,7 +89,7 @@ jobs:
|
||||
- ~/repo/packages/sol-compiler/coverage/lcov.info
|
||||
test-rest:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -131,7 +131,7 @@ jobs:
|
||||
lint:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
@@ -140,7 +140,7 @@ jobs:
|
||||
prettier:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
@@ -148,7 +148,7 @@ jobs:
|
||||
- run: yarn prettier:ci
|
||||
submit-coverage:
|
||||
docker:
|
||||
- image: circleci/node:6.12
|
||||
- image: circleci/node:9
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- restore_cache:
|
||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -67,6 +67,9 @@ generated_docs/
|
||||
|
||||
TODO.md
|
||||
|
||||
# VSCode file
|
||||
.vscode
|
||||
|
||||
packages/website/public/bundle*
|
||||
packages/react-docs/example/public/bundle*
|
||||
|
||||
@@ -93,3 +96,5 @@ packages/sol-compiler/solc_bin/
|
||||
|
||||
# Monorepo scripts
|
||||
packages/*/scripts/
|
||||
|
||||
ganache.log
|
||||
|
20
package.json
20
package.json
@@ -13,16 +13,18 @@
|
||||
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc",
|
||||
"report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls",
|
||||
"test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js",
|
||||
"run:publish": "run-s install:all rebuild script:publish",
|
||||
"run:publish:dry": "run-s install:all rebuild script:publish:dry",
|
||||
"run:publish": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild script:publish",
|
||||
"run:publish:dry": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild script:publish:dry",
|
||||
"script:prepublish_checks": "node ./packages/monorepo-scripts/lib/prepublish_checks.js",
|
||||
"script:publish": "node ./packages/monorepo-scripts/lib/publish.js",
|
||||
"script:publish:dry": "IS_DRY_RUN=true yarn script:publish",
|
||||
"install:all": "yarn install",
|
||||
"wsrun": "wsrun",
|
||||
"lerna:run": "lerna run",
|
||||
"watch": "wsrun watch $PKG -r --stages --done-criteria='complete|successfully'",
|
||||
"build": "wsrun build $PKG -r --stages",
|
||||
"clean": "wsrun clean $PKG -r --parallel",
|
||||
"watch": "wsrun watch $PKG --fast-exit -r --stages --done-criteria='complete|successfully'",
|
||||
"build": "wsrun build $PKG --fast-exit -r --stages",
|
||||
"build:monorepo_scripts": "PKG=@0xproject/monorepo-scripts yarn build",
|
||||
"clean": "wsrun clean $PKG --fast-exit -r --parallel",
|
||||
"rebuild": "run-s clean build",
|
||||
"test": "wsrun test $PKG --serial --exclude-missing",
|
||||
"stage_docs": "wsrun docs:stage $PKG --parallel --exclude-missing",
|
||||
@@ -32,13 +34,13 @@
|
||||
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic"
|
||||
},
|
||||
"devDependencies": {
|
||||
"async-child-process": "^1.1.1",
|
||||
"async-child-process": "1.1.1",
|
||||
"coveralls": "^3.0.0",
|
||||
"ganache-cli": "^6.1.0",
|
||||
"lcov-result-merger": "^2.0.0",
|
||||
"lcov-result-merger": "^3.0.0",
|
||||
"lerna": "^2.5.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"prettier": "^1.11.1",
|
||||
"npm-run-all": "4.1.2",
|
||||
"prettier": "1.12.1",
|
||||
"wsrun": "^2.2.0"
|
||||
}
|
||||
}
|
||||
|
@@ -9,3 +9,5 @@ test/
|
||||
/generated_docs/
|
||||
/scripts/
|
||||
/lib/src/monorepo_scripts/
|
||||
/lib/test/
|
||||
ganache.log
|
||||
|
@@ -1,4 +1,58 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.38.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.38.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.38.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527617805,
|
||||
"version": "0.38.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527617227,
|
||||
"version": "0.38.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527616612,
|
||||
"version": "0.38.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.38.0",
|
||||
"changes": [
|
||||
|
@@ -5,12 +5,36 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.38.6 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.38.5 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.38.4 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.38.3 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.38.2 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.38.1 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.38.0 - _May 22, 2018_
|
||||
|
||||
* Renamed createOrderStateWatcher to createOrderWatcherAsync since it is now async (#579)
|
||||
* Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage (#579)
|
||||
|
||||
## v0.37.2 - _May 4, 2018_
|
||||
## v0.37.2 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "0.38.0",
|
||||
"version": "0.38.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -66,50 +66,49 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0xproject/abi-gen": "^0.3.0",
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/migrations": "^0.0.6",
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/sol-compiler": "^0.5.0",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@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",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/sinon": "^2.2.2",
|
||||
"awesome-typescript-loader": "^3.1.3",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^2.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"json-loader": "^0.5.4",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"opn-cli": "^3.1.0",
|
||||
"prettier": "^1.11.1",
|
||||
"shx": "^0.2.2",
|
||||
"sinon": "^4.0.0",
|
||||
"source-map-support": "^0.5.0",
|
||||
"@types/mocha": "2.2.48",
|
||||
"@types/node": "9.6.0",
|
||||
"@types/sinon": "2.3.7",
|
||||
"awesome-typescript-loader": "3.5.0",
|
||||
"chai": "4.1.2",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"chai-bignumber": "2.0.1",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"json-loader": "0.5.7",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"opn-cli": "3.1.0",
|
||||
"prettier": "1.12.1",
|
||||
"shx": "0.2.2",
|
||||
"sinon": "4.4.9",
|
||||
"source-map-support": "0.5.4",
|
||||
"tslint": "5.8.0",
|
||||
"typedoc": "0xProject/typedoc",
|
||||
"typescript": "2.7.1",
|
||||
"webpack": "^3.1.0"
|
||||
"webpack": "3.11.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/assert": "^0.2.10",
|
||||
"@0xproject/base-contract": "^0.3.2",
|
||||
"@0xproject/contract-wrappers": "^0.0.2",
|
||||
"@0xproject/order-utils": "^0.0.5",
|
||||
"@0xproject/order-watcher": "^0.0.2",
|
||||
"@0xproject/sol-compiler": "^0.5.0",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"ethers": "^3.0.15",
|
||||
"lodash": "^4.17.4"
|
||||
"@0xproject/assert": "^0.2.14",
|
||||
"@0xproject/base-contract": "^0.3.6",
|
||||
"@0xproject/contract-wrappers": "^0.1.1",
|
||||
"@0xproject/order-utils": "^0.0.9",
|
||||
"@0xproject/order-watcher": "^0.0.8",
|
||||
"@0xproject/sol-compiler": "^0.5.4",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"ethers": "3.0.22",
|
||||
"lodash": "4.17.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -19,6 +19,8 @@ export {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
} from '@0xproject/types';
|
||||
|
||||
export { OrderWatcherConfig } from '@0xproject/order-watcher';
|
||||
|
||||
export {
|
||||
EventCallback,
|
||||
ContractEvent,
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.3.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.3.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.3.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.3.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"version": "0.3.0",
|
||||
"changes": [
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.3.4 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.3.3 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.3.2 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.3.1 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.3.0 - _May 22, 2018_
|
||||
|
||||
* Properly export the executable binary (#588)
|
||||
|
||||
## v0.2.13 - _May 4, 2018_
|
||||
## v0.2.13 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/abi-gen",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -27,29 +27,29 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
|
||||
"dependencies": {
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"chalk": "^2.3.0",
|
||||
"glob": "^7.1.2",
|
||||
"handlebars": "^4.0.11",
|
||||
"lodash": "^4.17.4",
|
||||
"mkdirp": "^0.5.1",
|
||||
"to-snake-case": "^1.0.0",
|
||||
"yargs": "^10.0.3"
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"chalk": "2.3.2",
|
||||
"glob": "7.1.1",
|
||||
"handlebars": "4.0.11",
|
||||
"lodash": "4.17.10",
|
||||
"mkdirp": "0.5.1",
|
||||
"to-snake-case": "1.0.0",
|
||||
"yargs": "11.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@types/glob": "^5.0.33",
|
||||
"@types/handlebars": "^4.0.36",
|
||||
"@types/mkdirp": "^0.5.1",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/yargs": "^10.0.0",
|
||||
"copyfiles": "^1.2.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/glob": "5.0.35",
|
||||
"@types/handlebars": "4.0.36",
|
||||
"@types/mkdirp": "0.5.2",
|
||||
"@types/node": "9.6.0",
|
||||
"@types/yargs": "10.0.2",
|
||||
"copyfiles": "1.2.0",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.2.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.2.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.2.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.2.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"timestamp": 1527008270,
|
||||
"version": "0.2.10",
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.2.14 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.13 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.12 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.11 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.2.10 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.9 - _May 4, 2018_
|
||||
## v0.2.9 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/assert",
|
||||
"version": "0.2.10",
|
||||
"version": "0.2.14",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -30,28 +30,28 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md",
|
||||
"devDependencies": {
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/valid-url": "^1.0.2",
|
||||
"chai": "^4.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"shx": "^0.2.2",
|
||||
"@types/mocha": "2.2.48",
|
||||
"@types/valid-url": "1.0.2",
|
||||
"chai": "4.1.2",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/json-schemas": "^0.7.24",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"lodash": "^4.17.4",
|
||||
"valid-url": "^1.0.9"
|
||||
"@0xproject/json-schemas": "^0.8.3",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"lodash": "4.17.10",
|
||||
"valid-url": "1.0.9"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,41 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.3.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.3.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.3.4",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201"
|
||||
}
|
||||
],
|
||||
"timestamp": 1529397769
|
||||
},
|
||||
{
|
||||
"timestamp": 1527810075,
|
||||
"version": "0.3.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527008270,
|
||||
"version": "0.3.2",
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.3.6 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.3.5 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.3.4 - _June 19, 2018_
|
||||
|
||||
* Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201
|
||||
|
||||
## v0.3.3 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.3.2 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.3.1 - _May 4, 2018_
|
||||
## v0.3.1 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/base-contract",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -29,25 +29,25 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md",
|
||||
"devDependencies": {
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/lodash": "4.14.104",
|
||||
"chai": "^4.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"chai": "4.1.2",
|
||||
"copyfiles": "1.2.0",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"ethers": "^3.0.15",
|
||||
"lodash": "^4.17.4"
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"ethers": "3.0.22",
|
||||
"lodash": "4.17.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.6.17",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.6.16",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.6.15",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527616612,
|
||||
"version": "0.6.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527008270,
|
||||
"version": "0.6.13",
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.6.17 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.6.16 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.6.15 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.6.14 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.6.13 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.6.12 - _May 4, 2018_
|
||||
## v0.6.12 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/connect",
|
||||
"version": "0.6.13",
|
||||
"version": "0.6.17",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -50,37 +50,37 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
|
||||
"dependencies": {
|
||||
"@0xproject/assert": "^0.2.10",
|
||||
"@0xproject/json-schemas": "^0.7.24",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"isomorphic-fetch": "^2.2.1",
|
||||
"lodash": "^4.17.4",
|
||||
"query-string": "^5.0.1",
|
||||
"websocket": "^1.0.25"
|
||||
"@0xproject/assert": "^0.2.14",
|
||||
"@0xproject/json-schemas": "^0.8.3",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"isomorphic-fetch": "2.2.1",
|
||||
"lodash": "4.17.10",
|
||||
"query-string": "4.3.4",
|
||||
"websocket": "1.0.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@types/fetch-mock": "^5.12.1",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/fetch-mock": "5.12.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/query-string": "^5.0.1",
|
||||
"@types/websocket": "^0.0.34",
|
||||
"async-child-process": "^1.1.1",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"fetch-mock": "^5.13.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"shx": "^0.2.2",
|
||||
"@types/mocha": "2.2.48",
|
||||
"@types/query-string": "5.1.0",
|
||||
"@types/websocket": "0.0.34",
|
||||
"async-child-process": "1.1.1",
|
||||
"chai": "4.1.2",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"fetch-mock": "5.13.1",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typedoc": "~0.8.0",
|
||||
"typedoc": "0.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -16,7 +16,7 @@ export interface OrderbookChannel {
|
||||
}
|
||||
|
||||
/**
|
||||
* heartbeatInterval: Interval in milliseconds that the orderbook channel should ping the underlying websocket. Default: 15000
|
||||
* heartbeatIntervalMs: Interval in milliseconds that the orderbook channel should ping the underlying websocket. Default: 15000
|
||||
*/
|
||||
export interface WebSocketOrderbookChannelConfig {
|
||||
heartbeatIntervalMs?: number;
|
||||
|
@@ -1,4 +1,50 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.1.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Update Blockstream dep. to V5.0 and no longer force unsubscribe on blockstream error (which are not recoverable)"
|
||||
}
|
||||
],
|
||||
"timestamp": 1531149657
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527617227,
|
||||
"version": "0.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527616612,
|
||||
"version": "0.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.0.2",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,26 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.1.1 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.1.0 - _July 9, 2018_
|
||||
|
||||
* Update Blockstream dep. to V5.0 and no longer force unsubscribe on blockstream error (which are not recoverable)
|
||||
|
||||
## v0.0.5 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.4 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.3 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.2 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/contract-wrappers",
|
||||
"version": "0.0.2",
|
||||
"version": "0.1.1",
|
||||
"description": "Smart TS wrappers for 0x smart contracts",
|
||||
"keywords": [
|
||||
"0xproject",
|
||||
@@ -27,13 +27,7 @@
|
||||
},
|
||||
"config": {
|
||||
"compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry",
|
||||
"contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels",
|
||||
"postpublish": {
|
||||
"assets": [
|
||||
"packages/contract-wrappers/_bundles/index.js",
|
||||
"packages/contract-wrappers/_bundles/index.min.js"
|
||||
]
|
||||
}
|
||||
"contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -44,53 +38,53 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/abi-gen": "^0.3.0",
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/migrations": "^0.0.6",
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/sol-compiler": "^0.5.0",
|
||||
"@0xproject/subproviders": "^0.10.2",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/abi-gen": "^0.3.4",
|
||||
"@0xproject/dev-utils": "^0.4.6",
|
||||
"@0xproject/migrations": "^0.0.10",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/subproviders": "^0.10.6",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/sinon": "^2.2.2",
|
||||
"@types/uuid": "^3.4.2",
|
||||
"awesome-typescript-loader": "^3.1.3",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^2.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"opn-cli": "^3.1.0",
|
||||
"prettier": "^1.11.1",
|
||||
"shx": "^0.2.2",
|
||||
"sinon": "^4.0.0",
|
||||
"source-map-support": "^0.5.0",
|
||||
"@types/mocha": "2.2.48",
|
||||
"@types/node": "9.6.0",
|
||||
"@types/sinon": "2.3.7",
|
||||
"@types/uuid": "3.4.3",
|
||||
"awesome-typescript-loader": "3.5.0",
|
||||
"chai": "4.1.2",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"chai-bignumber": "2.0.1",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"opn-cli": "3.1.0",
|
||||
"prettier": "1.12.1",
|
||||
"shx": "0.2.2",
|
||||
"sinon": "4.4.9",
|
||||
"source-map-support": "0.5.4",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1",
|
||||
"web3-provider-engine": "^14.0.4"
|
||||
"web3-provider-engine": "13.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/assert": "^0.2.10",
|
||||
"@0xproject/base-contract": "^0.3.2",
|
||||
"@0xproject/fill-scenarios": "^0.0.2",
|
||||
"@0xproject/json-schemas": "^0.7.24",
|
||||
"@0xproject/order-utils": "^0.0.5",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"ethereumjs-blockstream": "^2.0.6",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethers": "^3.0.15",
|
||||
"js-sha3": "^0.7.0",
|
||||
"lodash": "^4.17.4",
|
||||
"uuid": "^3.1.0"
|
||||
"@0xproject/assert": "^0.2.14",
|
||||
"@0xproject/base-contract": "^0.3.6",
|
||||
"@0xproject/fill-scenarios": "^0.0.6",
|
||||
"@0xproject/json-schemas": "^0.8.3",
|
||||
"@0xproject/order-utils": "^0.0.9",
|
||||
"@0xproject/sol-compiler": "^0.5.4",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"ethereumjs-blockstream": "5.0.0",
|
||||
"ethereumjs-util": "5.1.5",
|
||||
"ethers": "3.0.22",
|
||||
"js-sha3": "0.7.0",
|
||||
"lodash": "4.17.10",
|
||||
"uuid": "3.2.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -7,9 +7,9 @@ import {
|
||||
LogWithDecodedArgs,
|
||||
RawLog,
|
||||
} from '@0xproject/types';
|
||||
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
|
||||
import { intervalUtils, logUtils } from '@0xproject/utils';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import { Block, BlockAndLogStreamer } from 'ethereumjs-blockstream';
|
||||
import { Block, BlockAndLogStreamer, Log } from 'ethereumjs-blockstream';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import {
|
||||
@@ -38,7 +38,7 @@ const CONTRACT_NAME_TO_NOT_FOUND_ERROR: {
|
||||
export class ContractWrapper {
|
||||
protected _web3Wrapper: Web3Wrapper;
|
||||
protected _networkId: number;
|
||||
private _blockAndLogStreamerIfExists?: BlockAndLogStreamer;
|
||||
private _blockAndLogStreamerIfExists?: BlockAndLogStreamer<Block, Log> | undefined;
|
||||
private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer;
|
||||
private _filters: { [filterToken: string]: FilterObject };
|
||||
private _filterCallbacks: {
|
||||
@@ -46,6 +46,13 @@ export class ContractWrapper {
|
||||
};
|
||||
private _onLogAddedSubscriptionToken: string | undefined;
|
||||
private _onLogRemovedSubscriptionToken: string | undefined;
|
||||
private static _onBlockstreamError(isVerbose: boolean, err: Error): void {
|
||||
// Noop on blockstream errors since they are automatically
|
||||
// recovered from and don't cause Blockstream to exit.
|
||||
if (isVerbose) {
|
||||
logUtils.warn(err.message);
|
||||
}
|
||||
}
|
||||
constructor(web3Wrapper: Web3Wrapper, networkId: number) {
|
||||
this._web3Wrapper = web3Wrapper;
|
||||
this._networkId = networkId;
|
||||
@@ -81,10 +88,11 @@ export class ContractWrapper {
|
||||
indexFilterValues: IndexedFilterValues,
|
||||
abi: ContractAbi,
|
||||
callback: EventCallback<ArgsType>,
|
||||
isVerbose: boolean = false,
|
||||
): string {
|
||||
const filter = filterUtils.getFilter(address, eventName, indexFilterValues, abi);
|
||||
if (_.isUndefined(this._blockAndLogStreamerIfExists)) {
|
||||
this._startBlockAndLogStream();
|
||||
this._startBlockAndLogStream(isVerbose);
|
||||
}
|
||||
const filterToken = filterUtils.generateUUID();
|
||||
this._filters[filterToken] = filter;
|
||||
@@ -155,20 +163,21 @@ export class ContractWrapper {
|
||||
}
|
||||
});
|
||||
}
|
||||
private _startBlockAndLogStream(): void {
|
||||
private _startBlockAndLogStream(isVerbose: boolean): void {
|
||||
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
|
||||
throw new Error(ContractWrappersError.SubscriptionAlreadyPresent);
|
||||
}
|
||||
this._blockAndLogStreamerIfExists = new BlockAndLogStreamer(
|
||||
this._web3Wrapper.getBlockAsync.bind(this._web3Wrapper),
|
||||
this._web3Wrapper.getLogsAsync.bind(this._web3Wrapper),
|
||||
ContractWrapper._onBlockstreamError.bind(this, isVerbose),
|
||||
);
|
||||
const catchAllLogFilter = {};
|
||||
this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter);
|
||||
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
|
||||
this._reconcileBlockAsync.bind(this),
|
||||
constants.DEFAULT_BLOCK_POLLING_INTERVAL,
|
||||
this._onReconcileBlockError.bind(this),
|
||||
ContractWrapper._onBlockstreamError.bind(this, isVerbose),
|
||||
);
|
||||
let isRemoved = false;
|
||||
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
|
||||
@@ -179,12 +188,6 @@ export class ContractWrapper {
|
||||
this._onLogStateChanged.bind(this, isRemoved),
|
||||
);
|
||||
}
|
||||
private _onReconcileBlockError(err: Error): void {
|
||||
const filterTokens = _.keys(this._filterCallbacks);
|
||||
_.each(filterTokens, filterToken => {
|
||||
this._unsubscribe(filterToken, err);
|
||||
});
|
||||
}
|
||||
private _setNetworkId(networkId: number): void {
|
||||
this._networkId = networkId;
|
||||
}
|
||||
|
@@ -133,6 +133,7 @@ export class EtherTokenWrapper extends ContractWrapper {
|
||||
* @param indexFilterValues An object where the keys are indexed args returned by the event and
|
||||
* the value is the value you are interested in. E.g `{_owner: aUserAddressHex}`
|
||||
* @param callback Callback that gets called when a log is added/removed
|
||||
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
|
||||
* @return Subscription token used later to unsubscribe
|
||||
*/
|
||||
public subscribe<ArgsType extends EtherTokenContractEventArgs>(
|
||||
@@ -140,6 +141,7 @@ export class EtherTokenWrapper extends ContractWrapper {
|
||||
eventName: EtherTokenEvents,
|
||||
indexFilterValues: IndexedFilterValues,
|
||||
callback: EventCallback<ArgsType>,
|
||||
isVerbose: boolean = false,
|
||||
): string {
|
||||
assert.isETHAddressHex('etherTokenAddress', etherTokenAddress);
|
||||
const normalizedEtherTokenAddress = etherTokenAddress.toLowerCase();
|
||||
@@ -152,6 +154,7 @@ export class EtherTokenWrapper extends ContractWrapper {
|
||||
indexFilterValues,
|
||||
artifacts.EtherToken.abi,
|
||||
callback,
|
||||
isVerbose,
|
||||
);
|
||||
return subscriptionToken;
|
||||
}
|
||||
|
@@ -652,12 +652,14 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
* @param indexFilterValues An object where the keys are indexed args returned by the event and
|
||||
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
|
||||
* @param callback Callback that gets called when a log is added/removed
|
||||
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
|
||||
* @return Subscription token used later to unsubscribe
|
||||
*/
|
||||
public subscribe<ArgsType extends ExchangeContractEventArgs>(
|
||||
eventName: ExchangeEvents,
|
||||
indexFilterValues: IndexedFilterValues,
|
||||
callback: EventCallback<ArgsType>,
|
||||
isVerbose: boolean = false,
|
||||
): string {
|
||||
assert.doesBelongToStringEnum('eventName', eventName, ExchangeEvents);
|
||||
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
|
||||
@@ -669,6 +671,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
indexFilterValues,
|
||||
artifacts.Exchange.abi,
|
||||
callback,
|
||||
isVerbose,
|
||||
);
|
||||
return subscriptionToken;
|
||||
}
|
||||
|
@@ -350,6 +350,7 @@ export class TokenWrapper extends ContractWrapper {
|
||||
* @param indexFilterValues An object where the keys are indexed args returned by the event and
|
||||
* the value is the value you are interested in. E.g `{maker: aUserAddressHex}`
|
||||
* @param callback Callback that gets called when a log is added/removed
|
||||
* @param isVerbose Enable verbose subscription warnings (e.g recoverable network issues encountered)
|
||||
* @return Subscription token used later to unsubscribe
|
||||
*/
|
||||
public subscribe<ArgsType extends TokenContractEventArgs>(
|
||||
@@ -357,6 +358,7 @@ export class TokenWrapper extends ContractWrapper {
|
||||
eventName: TokenEvents,
|
||||
indexFilterValues: IndexedFilterValues,
|
||||
callback: EventCallback<ArgsType>,
|
||||
isVerbose: boolean = false,
|
||||
): string {
|
||||
assert.isETHAddressHex('tokenAddress', tokenAddress);
|
||||
const normalizedTokenAddress = tokenAddress.toLowerCase();
|
||||
@@ -369,6 +371,7 @@ export class TokenWrapper extends ContractWrapper {
|
||||
indexFilterValues,
|
||||
artifacts.Token.abi,
|
||||
callback,
|
||||
isVerbose,
|
||||
);
|
||||
return subscriptionToken;
|
||||
}
|
||||
|
@@ -51,34 +51,6 @@ describe('SubscriptionTest', () => {
|
||||
_.each(stubs, s => s.restore());
|
||||
stubs = [];
|
||||
});
|
||||
it('Should receive the Error when an error occurs while fetching the block', (done: DoneCallback) => {
|
||||
(async () => {
|
||||
const errMsg = 'Error fetching block';
|
||||
const callback = callbackErrorReporter.assertNodeCallbackError(done, errMsg);
|
||||
stubs = [Sinon.stub((contractWrappers as any)._web3Wrapper, 'getBlockAsync').throws(new Error(errMsg))];
|
||||
contractWrappers.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
|
||||
await contractWrappers.token.setAllowanceAsync(
|
||||
tokenAddress,
|
||||
coinbase,
|
||||
addressWithoutFunds,
|
||||
allowanceAmount,
|
||||
);
|
||||
})().catch(done);
|
||||
});
|
||||
it('Should receive the Error when an error occurs while reconciling the new block', (done: DoneCallback) => {
|
||||
(async () => {
|
||||
const errMsg = 'Error fetching logs';
|
||||
const callback = callbackErrorReporter.assertNodeCallbackError(done, errMsg);
|
||||
stubs = [Sinon.stub((contractWrappers as any)._web3Wrapper, 'getLogsAsync').throws(new Error(errMsg))];
|
||||
contractWrappers.token.subscribe(tokenAddress, TokenEvents.Approval, indexFilterValues, callback);
|
||||
await contractWrappers.token.setAllowanceAsync(
|
||||
tokenAddress,
|
||||
coinbase,
|
||||
addressWithoutFunds,
|
||||
allowanceAmount,
|
||||
);
|
||||
})().catch(done);
|
||||
});
|
||||
it('Should allow unsubscribeAll to be called successfully after an error', (done: DoneCallback) => {
|
||||
(async () => {
|
||||
const callback = (err: Error | null, logEvent?: DecodedLogEvent<ApprovalContractEventArgs>) => _.noop;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// tslint:disable-next-line:no-unused-variable
|
||||
import { BaseContract } from '@0xproject/base-contract';
|
||||
import { ContractArtifact } from '@0xproject/sol-compiler';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, MethodAbi, Provider, TxData, TxDataPayable } from '@0xproject/types';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from '@0xproject/types';
|
||||
import { BigNumber, classUtils, logUtils, promisify } from '@0xproject/utils';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
|
@@ -1,4 +1,4 @@
|
||||
export interface {{name}}ContractEventArgs {
|
||||
export interface {{name}}ContractEventArgs extends DecodedLogArgs {
|
||||
{{#each inputs}}
|
||||
{{name}}: {{#returnType type components}}{{/returnType}};
|
||||
{{/each}}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "contracts",
|
||||
"version": "2.1.29",
|
||||
"version": "2.1.35",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,40 +42,40 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md",
|
||||
"devDependencies": {
|
||||
"@0xproject/abi-gen": "^0.3.0",
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/abi-gen": "^0.3.4",
|
||||
"@0xproject/dev-utils": "^0.4.6",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/yargs": "^10.0.0",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^2.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"prettier": "^1.11.1",
|
||||
"shx": "^0.2.2",
|
||||
"solc": "^0.4.23",
|
||||
"@types/node": "9.6.0",
|
||||
"@types/yargs": "10.0.2",
|
||||
"chai": "4.1.2",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"chai-bignumber": "2.0.1",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"prettier": "1.12.1",
|
||||
"shx": "0.2.2",
|
||||
"solc": "0.4.23",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1",
|
||||
"yargs": "^10.0.3"
|
||||
"yargs": "11.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"0x.js": "^0.38.0",
|
||||
"@0xproject/base-contract": "^0.3.2",
|
||||
"@0xproject/sol-compiler": "^0.5.0",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereumjs-abi": "^0.6.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethers": "^3.0.15",
|
||||
"lodash": "^4.17.4",
|
||||
"web3": "^0.20.0"
|
||||
"0x.js": "^0.38.6",
|
||||
"@0xproject/base-contract": "^0.3.6",
|
||||
"@0xproject/sol-compiler": "^0.5.4",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"bn.js": "4.11.7",
|
||||
"ethereumjs-abi": "0.6.5",
|
||||
"ethereumjs-util": "5.1.5",
|
||||
"ethers": "3.0.22",
|
||||
"lodash": "4.17.10",
|
||||
"web3": "0.20.6"
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.4.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.4.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.4.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.4.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"version": "0.4.2",
|
||||
"changes": [
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.4.6 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.4.5 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.4.4 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.4.3 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.4.2 - _May 22, 2018_
|
||||
|
||||
* Move callbackErrorReporter over from 0x.js (#579)
|
||||
|
||||
## v0.4.1 - _May 4, 2018_
|
||||
## v0.4.1 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/dev-utils",
|
||||
"version": "0.4.2",
|
||||
"version": "0.4.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -29,29 +29,29 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"chai": "^4.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"shx": "^0.2.2",
|
||||
"@types/mocha": "2.2.48",
|
||||
"chai": "4.1.2",
|
||||
"copyfiles": "1.2.0",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/sol-cov": "^0.0.11",
|
||||
"@0xproject/subproviders": "^0.10.2",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"lodash": "^4.17.4",
|
||||
"web3": "^0.20.0",
|
||||
"web3-provider-engine": "^14.0.4"
|
||||
"@0xproject/sol-cov": "^0.1.3",
|
||||
"@0xproject/subproviders": "^0.10.6",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"lodash": "4.17.10",
|
||||
"web3": "0.20.6",
|
||||
"web3-provider-engine": "13.8.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527616612,
|
||||
"version": "0.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527008544,
|
||||
"version": "0.0.2",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.6 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.5 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.4 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.3 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.2 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/fill-scenarios",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.6",
|
||||
"description": "0x order fill scenario generator",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
@@ -23,27 +23,27 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md",
|
||||
"devDependencies": {
|
||||
"@0xproject/abi-gen": "^0.3.0",
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/sol-compiler": "^0.5.0",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/abi-gen": "^0.3.4",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/sol-compiler": "^0.5.4",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/lodash": "4.14.104",
|
||||
"copyfiles": "^1.2.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"copyfiles": "1.2.0",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/base-contract": "^0.3.2",
|
||||
"@0xproject/order-utils": "^0.0.5",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"ethers": "^3.0.15",
|
||||
"lodash": "^4.17.4"
|
||||
"@0xproject/base-contract": "^0.3.6",
|
||||
"@0xproject/order-utils": "^0.0.9",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"ethers": "3.0.22",
|
||||
"lodash": "4.17.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.8.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.8.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.8.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.8.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"timestamp": 1527008794,
|
||||
"version": "0.7.24",
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.8.3 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.8.2 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.8.1 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.8.0 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.7.24 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.7.23 - _May 4, 2018_
|
||||
## v0.7.23 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/json-schemas",
|
||||
"version": "0.7.24",
|
||||
"version": "0.8.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -45,27 +45,27 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md",
|
||||
"dependencies": {
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@types/node": "^8.0.53",
|
||||
"jsonschema": "^1.2.0",
|
||||
"lodash.values": "^4.3.0"
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@types/node": "9.6.0",
|
||||
"jsonschema": "1.2.2",
|
||||
"lodash.values": "4.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@types/lodash.foreach": "^4.5.3",
|
||||
"@types/lodash.values": "^4.3.3",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"chai": "^4.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"lodash.foreach": "^4.5.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"shx": "^0.2.2",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@types/lodash.foreach": "4.5.3",
|
||||
"@types/lodash.values": "4.3.3",
|
||||
"@types/mocha": "2.2.48",
|
||||
"chai": "4.1.2",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"lodash.foreach": "4.5.0",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typedoc": "0xProject/typedoc",
|
||||
"typescript": "2.7.1"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/metacoin",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -26,28 +26,28 @@
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0xproject/abi-gen": "^0.3.0",
|
||||
"@0xproject/base-contract": "^0.3.2",
|
||||
"@0xproject/sol-compiler": "^0.5.0",
|
||||
"@0xproject/sol-cov": "^0.0.11",
|
||||
"@0xproject/subproviders": "^0.10.2",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"ethers": "^3.0.15",
|
||||
"lodash": "^4.17.4",
|
||||
"web3-provider-engine": "^14.0.4"
|
||||
"@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/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"ethers": "3.0.22",
|
||||
"lodash": "4.17.10",
|
||||
"web3-provider-engine": "13.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^2.0.1",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"@0xproject/dev-utils": "^0.4.6",
|
||||
"chai": "4.1.2",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"chai-bignumber": "2.0.1",
|
||||
"dirty-chai": "2.0.1",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
}
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"timestamp": 1527008794,
|
||||
"version": "0.0.6",
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.10 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.9 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.8 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.7 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.0.6 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.5 - _May 4, 2018_
|
||||
## v0.0.5 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -668,5 +668,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"networks": {
|
||||
"50": {
|
||||
"address": "0x48bacb9266a570d521063ef5dd96e61686dbe788",
|
||||
"links": {},
|
||||
"constructorArgs": "[\"0x1d7022f5b17d2f8b695918fb48fa1089c9f85401\",\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\"]"
|
||||
}
|
||||
}
|
||||
}
|
@@ -715,5 +715,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"networks": {
|
||||
"50": {
|
||||
"address": "0x34d402f14d58e001d8efbe6585051bf9706aa064",
|
||||
"links": {},
|
||||
"constructorArgs": "[[\"0x5409ed021d9299bf6814279a6a1411a7e866a631\",\"0x6ecbe1db9ef729cbe972c83fb886247691fb6beb\"],\"2\",\"0\",\"0x1dc4c1cefef38a777b15aa20260a54e584b16c48\"]"
|
||||
}
|
||||
}
|
||||
}
|
@@ -590,5 +590,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"networks": {
|
||||
"50": {
|
||||
"address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082",
|
||||
"links": {},
|
||||
"constructorArgs": "[]"
|
||||
}
|
||||
}
|
||||
}
|
@@ -226,5 +226,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"networks": {
|
||||
"50": {
|
||||
"address": "0x1dc4c1cefef38a777b15aa20260a54e584b16c48",
|
||||
"links": {},
|
||||
"constructorArgs": "[]"
|
||||
}
|
||||
}
|
||||
}
|
@@ -322,5 +322,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"networks": {
|
||||
"50": {
|
||||
"address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c",
|
||||
"links": {},
|
||||
"constructorArgs": "[]"
|
||||
}
|
||||
}
|
||||
}
|
@@ -278,5 +278,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"networks": {
|
||||
"50": {
|
||||
"address": "0x1d7022f5b17d2f8b695918fb48fa1089c9f85401",
|
||||
"links": {},
|
||||
"constructorArgs": "[]"
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/migrations",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -24,24 +24,24 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0xproject/abi-gen": "^0.3.0",
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"@0xproject/abi-gen": "^0.3.4",
|
||||
"@0xproject/dev-utils": "^0.4.6",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/base-contract": "^0.3.2",
|
||||
"@0xproject/sol-compiler": "^0.5.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"ethers": "^3.0.15",
|
||||
"lodash": "^4.17.4"
|
||||
"@0xproject/base-contract": "^0.3.6",
|
||||
"@0xproject/sol-compiler": "^0.5.4",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"ethers": "3.0.22",
|
||||
"lodash": "4.17.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.2.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529081166,
|
||||
"version": "0.2.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add `prepublish_checks` script",
|
||||
"pr": 650
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527008794,
|
||||
"version": "0.1.20",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.2.2 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.1 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.0 - _June 15, 2018_
|
||||
|
||||
* Add `prepublish_checks` script (#650)
|
||||
|
||||
## v0.1.20 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -8,8 +8,6 @@ This repository contains a few helpful scripts for working with this mono repo.
|
||||
|
||||
**`yarn find_unused_deps`**: Sometimes we accidentally leave dependencies listed in `package.json` that are no longer being used. This script finds potential dependencies that might no longer be in use. Please verify that it is no longer in use before removing, the `depcheck` package we use under-the-hood doesn't handle some TS quirks perfectly.
|
||||
|
||||
**`yarn remove_tags`**: Our publishing script calls `lerna publish` under-the-hood. If this command fails, it might have created new versioned git tags for each package. Removing these manually is tedious, so you can also run this command instead. Before doing so, check to see if `lerna` already created the publish commit. If so, first revert that with `git reset --hard HEAD~1`, then run this command.
|
||||
|
||||
**`yarn test:publish`**: Execute a test-run of the publish script. This dry run won't actually publish, nor will it commit/push anything to Github.
|
||||
|
||||
## Usage
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/monorepo-scripts",
|
||||
"version": "0.1.20",
|
||||
"version": "0.2.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -14,11 +14,10 @@
|
||||
"build": "tsc",
|
||||
"test:publish": "run-s build script:publish",
|
||||
"find_unused_deps": "run-s build script:find_unused_deps",
|
||||
"remove_tags": "run-s build script:remove_tags",
|
||||
"script:deps_versions": "node ./lib/deps_versions.js",
|
||||
"script:prepublish_checks": "node ./lib/prepublish_checks.js",
|
||||
"script:publish": "IS_DRY_RUN=true node ./lib/publish.js",
|
||||
"script:find_unused_deps": "node ./lib/find_unused_dependencies.js",
|
||||
"script:remove_tags": "node ./lib/remove_tags.js"
|
||||
"script:find_unused_deps": "node ./lib/find_unused_dependencies.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -30,32 +29,35 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/monorepo-scripts/README.md",
|
||||
"devDependencies": {
|
||||
"@types/glob": "^5.0.33",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/opn": "^5.1.0",
|
||||
"@types/rimraf": "^2.0.2",
|
||||
"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/glob": "5.0.35",
|
||||
"@types/node": "9.6.0",
|
||||
"@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",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/depcheck": "^0.6.0",
|
||||
"async-child-process": "^1.1.1",
|
||||
"chalk": "^2.3.0",
|
||||
"es6-promisify": "^5.0.0",
|
||||
"glob": "^7.1.2",
|
||||
"lodash": "^4.17.4",
|
||||
"@types/depcheck": "0.6.0",
|
||||
"async-child-process": "1.1.1",
|
||||
"chalk": "2.3.2",
|
||||
"es6-promisify": "5.0.0",
|
||||
"glob": "7.1.1",
|
||||
"isomorphic-fetch": "2.2.1",
|
||||
"lodash": "4.17.10",
|
||||
"moment": "2.21.0",
|
||||
"opn": "^5.3.0",
|
||||
"promisify-child-process": "^1.0.5",
|
||||
"prompt": "^1.0.0",
|
||||
"opn": "5.3.0",
|
||||
"promisify-child-process": "1.0.5",
|
||||
"prompt": "1.0.0",
|
||||
"publish-release": "0xproject/publish-release",
|
||||
"rimraf": "^2.6.2",
|
||||
"semver-diff": "^2.1.0",
|
||||
"rimraf": "2.6.2",
|
||||
"semver": "5.5.0",
|
||||
"semver-diff": "2.1.0",
|
||||
"semver-sort": "0.0.4"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -5,7 +5,7 @@ import * as fs from 'fs';
|
||||
import { sync as globSync } from 'glob';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { utils } from './utils';
|
||||
import { utils } from './utils/utils';
|
||||
|
||||
interface Dependencies {
|
||||
[depName: string]: string;
|
||||
|
@@ -7,7 +7,7 @@ import * as _ from 'lodash';
|
||||
import { exec as execAsync } from 'promisify-child-process';
|
||||
|
||||
import { constants } from './constants';
|
||||
import { utils } from './utils';
|
||||
import { utils } from './utils/utils';
|
||||
|
||||
// For some reason, `depcheck` hangs on some packages. Add them here.
|
||||
const IGNORE_PACKAGES = ['@0xproject/sol-compiler'];
|
||||
|
@@ -7,7 +7,7 @@ import * as publishRelease from 'publish-release';
|
||||
import semverSort = require('semver-sort');
|
||||
|
||||
import { constants } from './constants';
|
||||
import { utils } from './utils';
|
||||
import { utils } from './utils/utils';
|
||||
|
||||
const publishReleaseAsync = promisify(publishRelease);
|
||||
const generatedDocsDirectoryName = 'generated_docs';
|
||||
|
190
packages/monorepo-scripts/src/prepublish_checks.ts
Normal file
190
packages/monorepo-scripts/src/prepublish_checks.ts
Normal file
@@ -0,0 +1,190 @@
|
||||
import * as _ from 'lodash';
|
||||
import { exec as execAsync } from 'promisify-child-process';
|
||||
import semver = require('semver');
|
||||
import semverSort = require('semver-sort');
|
||||
|
||||
import { constants } from './constants';
|
||||
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);
|
||||
|
||||
await checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(updatedPublicLernaPackages);
|
||||
await checkChangelogFormatAsync(updatedPublicLernaPackages);
|
||||
await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicLernaPackages);
|
||||
await checkPublishRequiredSetupAsync();
|
||||
}
|
||||
|
||||
async function checkGitTagsForNextVersionAndDeleteIfExistAsync(
|
||||
updatedPublicLernaPackages: LernaPackage[],
|
||||
): Promise<void> {
|
||||
const packageNames = _.map(updatedPublicLernaPackages, lernaPackage => lernaPackage.package.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;
|
||||
const nextVersion = await utils.getNextPackageVersionAsync(currentVersion, packageName, packageLocation);
|
||||
|
||||
const remoteTagVersions = remoteTagVersionsByPackageName[packageName];
|
||||
if (_.includes(remoteTagVersions, nextVersion)) {
|
||||
const tagName = `:refs/tags/${packageName}@${nextVersion}`;
|
||||
await utils.removeRemoteTagAsync(tagName);
|
||||
}
|
||||
|
||||
const localTagVersions = localTagVersionsByPackageName[packageName];
|
||||
if (_.includes(localTagVersions, nextVersion)) {
|
||||
const tagName = `${packageName}@${nextVersion}`;
|
||||
await utils.removeLocalTagAsync(tagName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(
|
||||
updatedPublicLernaPackages: LernaPackage[],
|
||||
): 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;
|
||||
const packageRegistryJsonIfExists = await npmUtils.getPackageRegistryJsonIfExistsAsync(packageName);
|
||||
if (_.isUndefined(packageRegistryJsonIfExists)) {
|
||||
continue; // noop for packages not yet published to NPM
|
||||
}
|
||||
const allVersionsIncludingUnpublished = npmUtils.getPreviouslyPublishedVersions(packageRegistryJsonIfExists);
|
||||
const sortedVersions = semverSort.desc(allVersionsIncludingUnpublished);
|
||||
const latestNPMVersion = sortedVersions[0];
|
||||
if (packageVersion !== latestNPMVersion) {
|
||||
versionMismatches.push({
|
||||
packageJsonVersion: packageVersion,
|
||||
npmVersion: latestNPMVersion,
|
||||
packageName,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!_.isEmpty(versionMismatches)) {
|
||||
utils.log(`Found version mismatches between package.json and NPM published versions (might be unpublished).`);
|
||||
_.each(versionMismatches, versionMismatch => {
|
||||
utils.log(
|
||||
`${versionMismatch.packageName}: ${versionMismatch.packageJsonVersion} package.json, ${
|
||||
versionMismatch.npmVersion
|
||||
} on NPM`,
|
||||
);
|
||||
});
|
||||
throw new Error(`Please fix the above package.json/NPM inconsistencies.`);
|
||||
}
|
||||
}
|
||||
|
||||
async function checkChangelogFormatAsync(updatedPublicLernaPackages: LernaPackage[]): 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);
|
||||
|
||||
const currentVersion = lernaPackage.package.version;
|
||||
if (!_.isEmpty(changelog)) {
|
||||
const lastEntry = changelog[0];
|
||||
const doesLastEntryHaveTimestamp = !_.isUndefined(lastEntry.timestamp);
|
||||
if (semver.lt(lastEntry.version, currentVersion)) {
|
||||
changeLogInconsistencies.push({
|
||||
packageJsonVersion: currentVersion,
|
||||
changelogVersion: lastEntry.version,
|
||||
packageName,
|
||||
});
|
||||
} else if (semver.gt(lastEntry.version, currentVersion) && doesLastEntryHaveTimestamp) {
|
||||
// Remove incorrectly added timestamp
|
||||
delete changelog[0].timestamp;
|
||||
// Save updated CHANGELOG.json
|
||||
await changelogUtils.writeChangelogJsonFileAsync(lernaPackage.location, changelog);
|
||||
utils.log(`${packageName}: Removed timestamp from latest CHANGELOG.json entry.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!_.isEmpty(changeLogInconsistencies)) {
|
||||
utils.log(`CHANGELOG versions cannot below package.json versions:`);
|
||||
_.each(changeLogInconsistencies, inconsistency => {
|
||||
utils.log(
|
||||
`${inconsistency.packageName}: ${inconsistency.packageJsonVersion} package.json, ${
|
||||
inconsistency.changelogVersion
|
||||
} CHANGELOG.json`,
|
||||
);
|
||||
});
|
||||
throw new Error('Fix the above inconsistencies to continue.');
|
||||
}
|
||||
}
|
||||
|
||||
async function checkPublishRequiredSetupAsync(): Promise<void> {
|
||||
// check to see if logged into npm before publishing
|
||||
try {
|
||||
// HACK: for some reason on some setups, the `npm whoami` will not recognize a logged-in user
|
||||
// unless run with `sudo` (i.e Fabio's NVM setup) but is fine for others (Jacob's NVM setup).
|
||||
utils.log('Checking that the user is logged in on npm...');
|
||||
await execAsync(`sudo npm whoami`);
|
||||
} catch (err) {
|
||||
throw new Error('You must be logged into npm in the commandline to publish. Run `npm login` and try again.');
|
||||
}
|
||||
|
||||
// Check to see if Git personal token setup
|
||||
if (_.isUndefined(constants.githubPersonalAccessToken)) {
|
||||
throw new Error(
|
||||
'You must have a Github personal access token set to an envVar named `GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS`. Add it then try again.',
|
||||
);
|
||||
}
|
||||
|
||||
// Check Yarn version is 1.X
|
||||
utils.log('Checking the yarn version...');
|
||||
const result = await execAsync(`yarn --version`);
|
||||
const version = result.stdout;
|
||||
const versionSegments = version.split('.');
|
||||
const majorVersion = _.parseInt(versionSegments[0]);
|
||||
if (majorVersion < 1) {
|
||||
throw new Error('Your yarn version must be v1.x or higher. Upgrade yarn and try again.');
|
||||
}
|
||||
|
||||
// Check that `aws` commandline tool is installed
|
||||
try {
|
||||
utils.log('Checking that aws CLI tool is installed...');
|
||||
await execAsync(`aws help`);
|
||||
} catch (err) {
|
||||
throw new Error('You must have `awscli` commandline tool installed. Install it and try again.');
|
||||
}
|
||||
|
||||
// Check that `aws` credentials are setup
|
||||
try {
|
||||
utils.log('Checking that aws credentials are configured...');
|
||||
await execAsync(`aws sts get-caller-identity`);
|
||||
} catch (err) {
|
||||
throw new Error('You must setup your AWS credentials by running `aws configure`. Do this and try again.');
|
||||
}
|
||||
|
||||
utils.log('Checking that git branch is up to date with upstream...');
|
||||
await execAsync('git fetch');
|
||||
const res = await execAsync('git status -bs'); // s - short format, b - branch info
|
||||
/**
|
||||
* Possible outcomes
|
||||
* ## branch_name...origin/branch_name [behind n]
|
||||
* ## branch_name...origin/branch_name [ahead n]
|
||||
* ## branch_name...origin/branch_name
|
||||
*/
|
||||
const gitShortStatusHeader = res.stdout.split('\n')[0];
|
||||
if (gitShortStatusHeader.includes('behind')) {
|
||||
throw new Error('Your branch is behind upstream. Please pull before publishing.');
|
||||
} else if (gitShortStatusHeader.includes('ahead')) {
|
||||
throw new Error('Your branch is ahead of upstream. Please push before publishing.');
|
||||
}
|
||||
}
|
||||
|
||||
prepublishChecksAsync().catch(err => {
|
||||
utils.log(err.message);
|
||||
process.exit(1);
|
||||
});
|
@@ -1,26 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import * as promisify from 'es6-promisify';
|
||||
import * as fs from 'fs';
|
||||
import lernaGetPackages = require('lerna-get-packages');
|
||||
import * as _ from 'lodash';
|
||||
import * as moment from 'moment';
|
||||
import opn = require('opn');
|
||||
import * as path from 'path';
|
||||
import { exec as execAsync, spawn } from 'promisify-child-process';
|
||||
import * as prompt from 'prompt';
|
||||
import semver = require('semver');
|
||||
import semverDiff = require('semver-diff');
|
||||
import semverSort = require('semver-sort');
|
||||
|
||||
import { constants } from './constants';
|
||||
import { Changelog, Changes, PackageToVersionChange, SemVerIndex, UpdatedPackage } from './types';
|
||||
import { utils } from './utils';
|
||||
import { PackageToVersionChange, SemVerIndex, VersionChangelog } from './types';
|
||||
import { changelogUtils } from './utils/changelog_utils';
|
||||
import { utils } from './utils/utils';
|
||||
|
||||
const DOC_GEN_COMMAND = 'docs:json';
|
||||
const NPM_NAMESPACE = '@0xproject/';
|
||||
const IS_DRY_RUN = process.env.IS_DRY_RUN === 'true';
|
||||
const TODAYS_TIMESTAMP = moment().unix();
|
||||
const LERNA_EXECUTABLE = './node_modules/lerna/bin/lerna.js';
|
||||
const semverNameToIndex: { [semver: string]: number } = {
|
||||
patch: SemVerIndex.Patch,
|
||||
minor: SemVerIndex.Minor,
|
||||
@@ -39,11 +37,6 @@ const packageNameToWebsitePath: { [name: string]: string } = {
|
||||
};
|
||||
|
||||
(async () => {
|
||||
const hasRequiredSetup = await checkPublishRequiredSetupAsync();
|
||||
if (!hasRequiredSetup) {
|
||||
return; // abort
|
||||
}
|
||||
|
||||
// Fetch public, updated Lerna packages
|
||||
const shouldIncludePrivate = false;
|
||||
const updatedPublicLernaPackages = await utils.getUpdatedLernaPackagesAsync(shouldIncludePrivate);
|
||||
@@ -114,54 +107,6 @@ package.ts. Please add an entry for it and try again.`,
|
||||
}
|
||||
}
|
||||
|
||||
async function checkPublishRequiredSetupAsync(): Promise<boolean> {
|
||||
// check to see if logged into npm before publishing
|
||||
try {
|
||||
// HACK: for some reason on some setups, the `npm whoami` will not recognize a logged-in user
|
||||
// unless run with `sudo` (i.e Fabio's NVM setup) but is fine for others (Jacob's N setup).
|
||||
await execAsync(`sudo npm whoami`);
|
||||
} catch (err) {
|
||||
utils.log('You must be logged into npm in the commandline to publish. Run `npm login` and try again.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check to see if Git personal token setup
|
||||
if (_.isUndefined(constants.githubPersonalAccessToken)) {
|
||||
utils.log(
|
||||
'You must have a Github personal access token set to an envVar named `GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS`. Add it then try again.',
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check Yarn version is 1.X
|
||||
const result = await execAsync(`yarn --version`);
|
||||
const version = result.stdout;
|
||||
const versionSegments = version.split('.');
|
||||
const majorVersion = _.parseInt(versionSegments[0]);
|
||||
if (majorVersion < 1) {
|
||||
utils.log('Your yarn version must be v1.x or higher. Upgrade yarn and try again.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that `aws` commandline tool is installed
|
||||
try {
|
||||
await execAsync(`aws help`);
|
||||
} catch (err) {
|
||||
utils.log('You must have `awscli` commandline tool installed. Install it and try again.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that `aws` credentials are setup
|
||||
try {
|
||||
await execAsync(`aws sts get-caller-identity`);
|
||||
} catch (err) {
|
||||
utils.log('You must setup your AWS credentials by running `aws configure`. Do this and try again.');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
async function pushChangelogsToGithubAsync(): Promise<void> {
|
||||
await execAsync(`git add . --all`, { cwd: constants.monorepoRootPath });
|
||||
await execAsync(`git commit -m "Updated CHANGELOGS"`, { cwd: constants.monorepoRootPath });
|
||||
@@ -173,55 +118,50 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
|
||||
const packageToVersionChange: PackageToVersionChange = {};
|
||||
for (const lernaPackage of updatedPublicLernaPackages) {
|
||||
const packageName = lernaPackage.package.name;
|
||||
const changelogJSONPath = path.join(lernaPackage.location, 'CHANGELOG.json');
|
||||
const changelogJSON = utils.getChangelogJSONOrCreateIfMissing(changelogJSONPath);
|
||||
let changelogs: Changelog[];
|
||||
try {
|
||||
changelogs = JSON.parse(changelogJSON);
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`${lernaPackage.package.name}'s CHANGELOG.json contains invalid JSON. Please fix and try again.`,
|
||||
);
|
||||
}
|
||||
let changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, lernaPackage.location);
|
||||
|
||||
const currentVersion = lernaPackage.package.version;
|
||||
const shouldAddNewEntry = shouldAddNewChangelogEntry(currentVersion, changelogs);
|
||||
const shouldAddNewEntry = changelogUtils.shouldAddNewChangelogEntry(
|
||||
lernaPackage.package.name,
|
||||
currentVersion,
|
||||
changelog,
|
||||
);
|
||||
if (shouldAddNewEntry) {
|
||||
// Create a new entry for a patch version with generic changelog entry.
|
||||
const nextPatchVersion = utils.getNextPatchVersion(currentVersion);
|
||||
const newChangelogEntry: Changelog = {
|
||||
const nextPatchVersionIfValid = semver.inc(currentVersion, 'patch');
|
||||
if (_.isNull(nextPatchVersionIfValid)) {
|
||||
throw new Error(`Encountered invalid semver version: ${currentVersion} for package: ${packageName}`);
|
||||
}
|
||||
const newChangelogEntry: VersionChangelog = {
|
||||
timestamp: TODAYS_TIMESTAMP,
|
||||
version: nextPatchVersion,
|
||||
version: nextPatchVersionIfValid,
|
||||
changes: [
|
||||
{
|
||||
note: 'Dependencies updated',
|
||||
},
|
||||
],
|
||||
};
|
||||
changelogs = [newChangelogEntry, ...changelogs];
|
||||
packageToVersionChange[packageName] = semverDiff(currentVersion, nextPatchVersion);
|
||||
changelog = [newChangelogEntry, ...changelog];
|
||||
packageToVersionChange[packageName] = semverDiff(currentVersion, nextPatchVersionIfValid);
|
||||
} else {
|
||||
// Update existing entry with timestamp
|
||||
const lastEntry = changelogs[0];
|
||||
const lastEntry = changelog[0];
|
||||
if (_.isUndefined(lastEntry.timestamp)) {
|
||||
lastEntry.timestamp = TODAYS_TIMESTAMP;
|
||||
}
|
||||
// Check version number is correct.
|
||||
const proposedNextVersion = lastEntry.version;
|
||||
lastEntry.version = updateVersionNumberIfNeeded(currentVersion, proposedNextVersion);
|
||||
changelogs[0] = lastEntry;
|
||||
changelog[0] = lastEntry;
|
||||
packageToVersionChange[packageName] = semverDiff(currentVersion, lastEntry.version);
|
||||
}
|
||||
|
||||
// Save updated CHANGELOG.json
|
||||
fs.writeFileSync(changelogJSONPath, JSON.stringify(changelogs, null, '\t'));
|
||||
await utils.prettifyAsync(changelogJSONPath, constants.monorepoRootPath);
|
||||
await changelogUtils.writeChangelogJsonFileAsync(lernaPackage.location, changelog);
|
||||
utils.log(`${packageName}: Updated CHANGELOG.json`);
|
||||
// Generate updated CHANGELOG.md
|
||||
const changelogMd = generateChangelogMd(changelogs);
|
||||
const changelogMdPath = path.join(lernaPackage.location, 'CHANGELOG.md');
|
||||
fs.writeFileSync(changelogMdPath, changelogMd);
|
||||
await utils.prettifyAsync(changelogMdPath, constants.monorepoRootPath);
|
||||
const changelogMd = changelogUtils.generateChangelogMd(changelog);
|
||||
await changelogUtils.writeChangelogMdFileAsync(lernaPackage.location, changelogMd);
|
||||
utils.log(`${packageName}: Updated CHANGELOG.md`);
|
||||
}
|
||||
|
||||
@@ -231,7 +171,8 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
|
||||
async function lernaPublishAsync(packageToVersionChange: { [name: string]: string }): Promise<void> {
|
||||
// HACK: Lerna publish does not provide a way to specify multiple package versions via
|
||||
// flags so instead we need to interact with their interactive prompt interface.
|
||||
const child = spawn('lerna', ['publish', '--registry=https://registry.npmjs.org/'], {
|
||||
const PACKAGE_REGISTRY = 'https://registry.npmjs.org/';
|
||||
const child = spawn('lerna', ['publish', `--registry=${PACKAGE_REGISTRY}`], {
|
||||
cwd: constants.monorepoRootPath,
|
||||
});
|
||||
let shouldPrintOutput = false;
|
||||
@@ -270,55 +211,16 @@ async function lernaPublishAsync(packageToVersionChange: { [name: string]: strin
|
||||
}
|
||||
|
||||
function updateVersionNumberIfNeeded(currentVersion: string, proposedNextVersion: string): string {
|
||||
const updatedVersionIfValid = semver.inc(currentVersion, 'patch');
|
||||
if (_.isNull(updatedVersionIfValid)) {
|
||||
throw new Error(`Encountered invalid semver: ${currentVersion}`);
|
||||
}
|
||||
if (proposedNextVersion === currentVersion) {
|
||||
return utils.getNextPatchVersion(currentVersion);
|
||||
return updatedVersionIfValid;
|
||||
}
|
||||
const sortedVersions = semverSort.desc([proposedNextVersion, currentVersion]);
|
||||
if (sortedVersions[0] !== proposedNextVersion) {
|
||||
return utils.getNextPatchVersion(currentVersion);
|
||||
return updatedVersionIfValid;
|
||||
}
|
||||
return proposedNextVersion;
|
||||
}
|
||||
|
||||
function shouldAddNewChangelogEntry(currentVersion: string, changelogs: Changelog[]): boolean {
|
||||
if (_.isEmpty(changelogs)) {
|
||||
return true;
|
||||
}
|
||||
const lastEntry = changelogs[0];
|
||||
const isLastEntryCurrentVersion = lastEntry.version === currentVersion;
|
||||
return isLastEntryCurrentVersion;
|
||||
}
|
||||
|
||||
function generateChangelogMd(changelogs: Changelog[]): string {
|
||||
let changelogMd = `<!--
|
||||
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
|
||||
Edit the package's CHANGELOG.json file only.
|
||||
-->
|
||||
|
||||
CHANGELOG
|
||||
`;
|
||||
|
||||
_.each(changelogs, changelog => {
|
||||
if (_.isUndefined(changelog.timestamp)) {
|
||||
throw new Error(
|
||||
'All CHANGELOG.json entries must be updated to include a timestamp before generating their MD version',
|
||||
);
|
||||
}
|
||||
const date = moment(`${changelog.timestamp}`, 'X').format('MMMM D, YYYY');
|
||||
const title = `\n## v${changelog.version} - _${date}_\n\n`;
|
||||
changelogMd += title;
|
||||
|
||||
let changes = '';
|
||||
_.each(changelog.changes, change => {
|
||||
let line = ` * ${change.note}`;
|
||||
if (!_.isUndefined(change.pr)) {
|
||||
line += ` (#${change.pr})`;
|
||||
}
|
||||
line += '\n';
|
||||
changes += line;
|
||||
});
|
||||
changelogMd += `${changes}`;
|
||||
});
|
||||
|
||||
return changelogMd;
|
||||
}
|
||||
|
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import lernaGetPackages = require('lerna-get-packages');
|
||||
import * as _ from 'lodash';
|
||||
import * as path from 'path';
|
||||
import { exec as execAsync } from 'promisify-child-process';
|
||||
import semverSort = require('semver-sort');
|
||||
|
||||
import { constants } from './constants';
|
||||
import { Changelog } from './types';
|
||||
import { utils } from './utils';
|
||||
|
||||
(async () => {
|
||||
const shouldIncludePrivate = true;
|
||||
const updatedPublicLernaPackages = await utils.getUpdatedLernaPackagesAsync(shouldIncludePrivate);
|
||||
|
||||
for (const lernaPackage of updatedPublicLernaPackages) {
|
||||
const packageName = lernaPackage.package.name;
|
||||
const currentVersion = lernaPackage.package.version;
|
||||
const changelogJSONPath = path.join(lernaPackage.location, 'CHANGELOG.json');
|
||||
// Private packages don't have changelogs, and their versions are always incremented
|
||||
// by a patch version.
|
||||
const changelogJSONIfExists = utils.getChangelogJSONIfExists(changelogJSONPath);
|
||||
|
||||
let latestChangelogVersion: string;
|
||||
if (!_.isUndefined(changelogJSONIfExists)) {
|
||||
let changelogs: Changelog[];
|
||||
try {
|
||||
changelogs = JSON.parse(changelogJSONIfExists);
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`${lernaPackage.package.name}'s CHANGELOG.json contains invalid JSON. Please fix and try again.`,
|
||||
);
|
||||
}
|
||||
latestChangelogVersion = changelogs[0].version;
|
||||
} else {
|
||||
latestChangelogVersion = utils.getNextPatchVersion(currentVersion);
|
||||
}
|
||||
|
||||
const sortedVersions = semverSort.desc([latestChangelogVersion, currentVersion]);
|
||||
if (sortedVersions[0] === latestChangelogVersion && latestChangelogVersion !== currentVersion) {
|
||||
const tagName = `${packageName}@${latestChangelogVersion}`;
|
||||
try {
|
||||
await execAsync(`git tag -d ${tagName}`, { cwd: constants.monorepoRootPath });
|
||||
utils.log(`removed tag: ${tagName}`);
|
||||
} catch (err) {
|
||||
if (_.includes(err.message, 'not found')) {
|
||||
utils.log(`Could not find tag: ${tagName}`);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})().catch(err => {
|
||||
utils.log(err);
|
||||
process.exit(1);
|
||||
});
|
@@ -7,7 +7,7 @@ import * as path from 'path';
|
||||
import { exec as execAsync } from 'promisify-child-process';
|
||||
import * as rimraf from 'rimraf';
|
||||
|
||||
import { utils } from './utils';
|
||||
import { utils } from './utils/utils';
|
||||
|
||||
(async () => {
|
||||
const monorepoRootPath = path.join(__dirname, '../../..');
|
||||
|
@@ -4,15 +4,17 @@ export interface UpdatedPackage {
|
||||
private: boolean;
|
||||
}
|
||||
|
||||
export interface Changes {
|
||||
export interface Change {
|
||||
note: string;
|
||||
pr?: number;
|
||||
}
|
||||
|
||||
export interface Changelog {
|
||||
export type Changelog = VersionChangelog[];
|
||||
|
||||
export interface VersionChangelog {
|
||||
timestamp?: number;
|
||||
version: string;
|
||||
changes: Changes[];
|
||||
changes: Change[];
|
||||
}
|
||||
|
||||
export enum SemVerIndex {
|
||||
@@ -25,3 +27,16 @@ export enum SemVerIndex {
|
||||
export interface PackageToVersionChange {
|
||||
[name: string]: string;
|
||||
}
|
||||
|
||||
export interface PackageRegistryJson {
|
||||
versions: {
|
||||
[version: string]: any;
|
||||
};
|
||||
time: {
|
||||
[version: string]: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GitTagsByPackageName {
|
||||
[packageName: string]: string[];
|
||||
}
|
||||
|
@@ -1,64 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import lernaGetPackages = require('lerna-get-packages');
|
||||
import * as _ from 'lodash';
|
||||
import { exec as execAsync, spawn } from 'promisify-child-process';
|
||||
|
||||
import { constants } from './constants';
|
||||
import { UpdatedPackage } from './types';
|
||||
|
||||
export const utils = {
|
||||
log(...args: any[]): void {
|
||||
console.log(...args); // tslint:disable-line:no-console
|
||||
},
|
||||
getNextPatchVersion(currentVersion: string): string {
|
||||
const versionSegments = currentVersion.split('.');
|
||||
const patch = _.parseInt(_.last(versionSegments) as string);
|
||||
const newPatch = patch + 1;
|
||||
const newPatchVersion = `${versionSegments[0]}.${versionSegments[1]}.${newPatch}`;
|
||||
return newPatchVersion;
|
||||
},
|
||||
async prettifyAsync(filePath: string, cwd: string): Promise<void> {
|
||||
await execAsync(`prettier --write ${filePath} --config .prettierrc`, {
|
||||
cwd,
|
||||
});
|
||||
},
|
||||
async getUpdatedLernaPackagesAsync(shouldIncludePrivate: boolean): Promise<LernaPackage[]> {
|
||||
const updatedPublicPackages = await this.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);
|
||||
});
|
||||
return updatedPublicLernaPackages;
|
||||
},
|
||||
async getLernaUpdatedPackagesAsync(shouldIncludePrivate: boolean): Promise<UpdatedPackage[]> {
|
||||
const result = await execAsync(`${constants.lernaExecutable} updated --json`, {
|
||||
cwd: constants.monorepoRootPath,
|
||||
});
|
||||
const updatedPackages = JSON.parse(result.stdout);
|
||||
if (!shouldIncludePrivate) {
|
||||
const updatedPublicPackages = _.filter(updatedPackages, updatedPackage => !updatedPackage.private);
|
||||
return updatedPublicPackages;
|
||||
}
|
||||
return updatedPackages;
|
||||
},
|
||||
getChangelogJSONIfExists(changelogPath: string): string | undefined {
|
||||
try {
|
||||
const changelogJSON = fs.readFileSync(changelogPath, 'utf-8');
|
||||
return changelogJSON;
|
||||
} catch (err) {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
getChangelogJSONOrCreateIfMissing(changelogPath: string): string {
|
||||
const changelogIfExists = this.getChangelogJSONIfExists(changelogPath);
|
||||
if (_.isUndefined(changelogIfExists)) {
|
||||
// If none exists, create new, empty one.
|
||||
const emptyChangelogJSON = JSON.stringify([]);
|
||||
fs.writeFileSync(changelogPath, emptyChangelogJSON);
|
||||
return emptyChangelogJSON;
|
||||
}
|
||||
return changelogIfExists;
|
||||
},
|
||||
};
|
108
packages/monorepo-scripts/src/utils/changelog_utils.ts
Normal file
108
packages/monorepo-scripts/src/utils/changelog_utils.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
import * as fs from 'fs';
|
||||
import * as _ from 'lodash';
|
||||
import * as moment from 'moment';
|
||||
import * as path from 'path';
|
||||
import { exec as execAsync } from 'promisify-child-process';
|
||||
import semver = require('semver');
|
||||
|
||||
import { constants } from '../constants';
|
||||
import { Change, Changelog, VersionChangelog } from '../types';
|
||||
|
||||
const CHANGELOG_MD_HEADER = `
|
||||
<!--
|
||||
This file is auto-generated using the monorepo-scripts package. Don't edit directly.
|
||||
Edit the package's CHANGELOG.json file only.
|
||||
-->
|
||||
|
||||
CHANGELOG
|
||||
`;
|
||||
|
||||
export const changelogUtils = {
|
||||
getChangelogMdTitle(versionChangelog: VersionChangelog): string {
|
||||
if (_.isUndefined(versionChangelog.timestamp)) {
|
||||
throw new Error(
|
||||
`All CHANGELOG.json entries must be updated to include a timestamp before generating their MD version. Got: ${JSON.stringify(
|
||||
versionChangelog,
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
const date = moment(`${versionChangelog.timestamp}`, 'X').format('MMMM D, YYYY');
|
||||
const title = `\n## v${versionChangelog.version} - _${date}_\n\n`;
|
||||
return title;
|
||||
},
|
||||
getChangelogMdChange(change: Change): string {
|
||||
let line = ` * ${change.note}`;
|
||||
if (!_.isUndefined(change.pr)) {
|
||||
line += ` (#${change.pr})`;
|
||||
}
|
||||
return line;
|
||||
},
|
||||
generateChangelogMd(changelog: Changelog): string {
|
||||
let changelogMd = CHANGELOG_MD_HEADER;
|
||||
_.each(changelog, versionChangelog => {
|
||||
const title = changelogUtils.getChangelogMdTitle(versionChangelog);
|
||||
changelogMd += title;
|
||||
const changelogVersionLines = _.map(
|
||||
versionChangelog.changes,
|
||||
changelogUtils.getChangelogMdChange.bind(changelogUtils),
|
||||
);
|
||||
changelogMd += `${_.join(changelogVersionLines, '\n')}`;
|
||||
});
|
||||
|
||||
return changelogMd;
|
||||
},
|
||||
shouldAddNewChangelogEntry(packageName: string, currentVersion: string, changelog: Changelog): boolean {
|
||||
if (_.isEmpty(changelog)) {
|
||||
return true;
|
||||
}
|
||||
const lastEntry = changelog[0];
|
||||
if (semver.lt(lastEntry.version, currentVersion)) {
|
||||
throw new Error(
|
||||
`Found CHANGELOG version lower then current package version. ${packageName} current: ${currentVersion}, Changelog: ${
|
||||
lastEntry.version
|
||||
}`,
|
||||
);
|
||||
}
|
||||
const isLastEntryCurrentVersion = lastEntry.version === currentVersion;
|
||||
return isLastEntryCurrentVersion;
|
||||
},
|
||||
getChangelogJSONIfExists(changelogPath: string): string | undefined {
|
||||
try {
|
||||
const changelogJSON = fs.readFileSync(changelogPath, 'utf-8');
|
||||
return changelogJSON;
|
||||
} catch (err) {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
getChangelogOrCreateIfMissing(packageName: string, packageLocation: string): Changelog {
|
||||
const changelogJSONPath = path.join(packageLocation, 'CHANGELOG.json');
|
||||
let changelogJsonIfExists = this.getChangelogJSONIfExists(changelogJSONPath);
|
||||
if (_.isUndefined(changelogJsonIfExists)) {
|
||||
// If none exists, create new, empty one.
|
||||
changelogJsonIfExists = '[]';
|
||||
fs.writeFileSync(changelogJSONPath, changelogJsonIfExists);
|
||||
}
|
||||
let changelog: Changelog;
|
||||
try {
|
||||
changelog = JSON.parse(changelogJsonIfExists);
|
||||
} catch (err) {
|
||||
throw new Error(`${packageName}'s CHANGELOG.json contains invalid JSON. Please fix and try again.`);
|
||||
}
|
||||
return changelog;
|
||||
},
|
||||
async writeChangelogJsonFileAsync(packageLocation: string, changelog: Changelog): Promise<void> {
|
||||
const changelogJSONPath = path.join(packageLocation, 'CHANGELOG.json');
|
||||
fs.writeFileSync(changelogJSONPath, JSON.stringify(changelog, null, '\t'));
|
||||
await this.prettifyAsync(changelogJSONPath, constants.monorepoRootPath);
|
||||
},
|
||||
async writeChangelogMdFileAsync(packageLocation: string, changelogMdString: string): Promise<void> {
|
||||
const changelogMarkdownPath = path.join(packageLocation, 'CHANGELOG.md');
|
||||
fs.writeFileSync(changelogMarkdownPath, changelogMdString);
|
||||
await this.prettifyAsync(changelogMarkdownPath, constants.monorepoRootPath);
|
||||
},
|
||||
async prettifyAsync(filePath: string, cwd: string): Promise<void> {
|
||||
await execAsync(`prettier --write ${filePath} --config .prettierrc`, {
|
||||
cwd,
|
||||
});
|
||||
},
|
||||
};
|
28
packages/monorepo-scripts/src/utils/npm_utils.ts
Normal file
28
packages/monorepo-scripts/src/utils/npm_utils.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'isomorphic-fetch';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { PackageRegistryJson } from '../types';
|
||||
|
||||
const NPM_REGISTRY_BASE_URL = 'https://registry.npmjs.org';
|
||||
const SUCCESS_STATUS = 200;
|
||||
const NOT_FOUND_STATUS = 404;
|
||||
|
||||
export const npmUtils = {
|
||||
async getPackageRegistryJsonIfExistsAsync(packageName: string): Promise<PackageRegistryJson | undefined> {
|
||||
const url = `${NPM_REGISTRY_BASE_URL}/${packageName}`;
|
||||
const response = await fetch(url);
|
||||
|
||||
if (response.status === NOT_FOUND_STATUS) {
|
||||
return undefined;
|
||||
} else if (response.status !== SUCCESS_STATUS) {
|
||||
throw new Error(`Request to ${url} failed. Check your internet connection and that npmjs.org is up.`);
|
||||
}
|
||||
const packageRegistryJson = await response.json();
|
||||
return packageRegistryJson;
|
||||
},
|
||||
getPreviouslyPublishedVersions(packageRegistryJson: PackageRegistryJson): string[] {
|
||||
const timeWithOnlyVersions = _.omit(packageRegistryJson.time, ['modified', 'created']);
|
||||
const versions = _.keys(timeWithOnlyVersions);
|
||||
return versions;
|
||||
},
|
||||
};
|
125
packages/monorepo-scripts/src/utils/utils.ts
Normal file
125
packages/monorepo-scripts/src/utils/utils.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
import lernaGetPackages = require('lerna-get-packages');
|
||||
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 { changelogUtils } from './changelog_utils';
|
||||
|
||||
export const utils = {
|
||||
log(...args: any[]): void {
|
||||
console.log(...args); // tslint:disable-line:no-console
|
||||
},
|
||||
async getUpdatedLernaPackagesAsync(shouldIncludePrivate: boolean): Promise<LernaPackage[]> {
|
||||
const updatedPublicPackages = await this.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);
|
||||
});
|
||||
return updatedPublicLernaPackages;
|
||||
},
|
||||
async getLernaUpdatedPackagesAsync(shouldIncludePrivate: boolean): Promise<UpdatedPackage[]> {
|
||||
const result = await execAsync(`${constants.lernaExecutable} updated --json`, {
|
||||
cwd: constants.monorepoRootPath,
|
||||
});
|
||||
const updatedPackages = JSON.parse(result.stdout);
|
||||
if (!shouldIncludePrivate) {
|
||||
const updatedPublicPackages = _.filter(updatedPackages, updatedPackage => !updatedPackage.private);
|
||||
return updatedPublicPackages;
|
||||
}
|
||||
return updatedPackages;
|
||||
},
|
||||
async getNextPackageVersionAsync(
|
||||
currentVersion: string,
|
||||
packageName: string,
|
||||
packageLocation: string,
|
||||
): Promise<string> {
|
||||
let nextVersionIfValid;
|
||||
const changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, packageLocation);
|
||||
if (_.isEmpty(changelog)) {
|
||||
nextVersionIfValid = semver.inc(currentVersion, 'patch');
|
||||
}
|
||||
const lastEntry = changelog[0];
|
||||
if (semver.gt(currentVersion, lastEntry.version)) {
|
||||
throw new Error(`Package.json version cannot be greater then last CHANGELOG entry. Check: ${packageName}`);
|
||||
}
|
||||
nextVersionIfValid = semver.eq(lastEntry.version, currentVersion)
|
||||
? semver.inc(currentVersion, 'patch')
|
||||
: lastEntry.version;
|
||||
if (_.isNull(nextVersionIfValid)) {
|
||||
throw new Error(`Encountered invalid semver: ${currentVersion} associated with ${packageName}`);
|
||||
}
|
||||
return nextVersionIfValid;
|
||||
},
|
||||
async getRemoteGitTagsAsync(): Promise<string[]> {
|
||||
const result = await execAsync(`git ls-remote --tags`, {
|
||||
cwd: constants.monorepoRootPath,
|
||||
});
|
||||
const tagsString = result.stdout;
|
||||
const tagOutputs: string[] = tagsString.split('\n');
|
||||
const tags = _.compact(
|
||||
_.map(tagOutputs, tagOutput => {
|
||||
const tag = tagOutput.split('refs/tags/')[1];
|
||||
// Tags with `^{}` are duplicateous so we ignore them
|
||||
// Source: https://stackoverflow.com/questions/15472107/when-listing-git-ls-remote-why-theres-after-the-tag-name
|
||||
if (_.endsWith(tag, '^{}')) {
|
||||
return undefined;
|
||||
}
|
||||
return tag;
|
||||
}),
|
||||
);
|
||||
return tags;
|
||||
},
|
||||
async getLocalGitTagsAsync(): Promise<string[]> {
|
||||
const result = await execAsync(`git tags`, {
|
||||
cwd: constants.monorepoRootPath,
|
||||
});
|
||||
const tagsString = result.stdout;
|
||||
const tags = tagsString.split('\n');
|
||||
return tags;
|
||||
},
|
||||
async getGitTagsByPackageNameAsync(packageNames: string[], gitTags: string[]): Promise<GitTagsByPackageName> {
|
||||
const tagVersionByPackageName: GitTagsByPackageName = {};
|
||||
_.each(gitTags, tag => {
|
||||
const packageNameIfExists = _.find(packageNames, name => {
|
||||
return _.includes(tag, `${name}@`);
|
||||
});
|
||||
if (_.isUndefined(packageNameIfExists)) {
|
||||
return; // ignore tags not related to a package we care about.
|
||||
}
|
||||
const splitTag = tag.split(`${packageNameIfExists}@`);
|
||||
if (splitTag.length !== 2) {
|
||||
throw new Error(`Unexpected tag name found: ${tag}`);
|
||||
}
|
||||
const version = splitTag[1];
|
||||
(tagVersionByPackageName[packageNameIfExists] || (tagVersionByPackageName[packageNameIfExists] = [])).push(
|
||||
version,
|
||||
);
|
||||
});
|
||||
return tagVersionByPackageName;
|
||||
},
|
||||
async removeLocalTagAsync(tagName: string): Promise<void> {
|
||||
try {
|
||||
await execAsync(`git tag -d ${tagName}`, {
|
||||
cwd: constants.monorepoRootPath,
|
||||
});
|
||||
} catch (err) {
|
||||
throw new Error(`Failed to delete local git tag. Got err: ${err}`);
|
||||
}
|
||||
this.log(`Removed local tag: ${tagName}`);
|
||||
},
|
||||
async removeRemoteTagAsync(tagName: string): Promise<void> {
|
||||
try {
|
||||
await execAsync(`git push origin ${tagName}`, {
|
||||
cwd: constants.monorepoRootPath,
|
||||
});
|
||||
} catch (err) {
|
||||
throw new Error(`Failed to delete remote git tag. Got err: ${err}`);
|
||||
}
|
||||
this.log(`Removed remote tag: ${tagName}`);
|
||||
},
|
||||
};
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.0.9",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527616612,
|
||||
"version": "0.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.0.5",
|
||||
"changes": [
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.9 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.8 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.7 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.6 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.5 - _May 22, 2018_
|
||||
|
||||
* Add orderStateUtils, a module for computing order state needed to decide if an order is still valid
|
||||
|
||||
## v0.0.4 - _May 4, 2018_
|
||||
## v0.0.4 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/order-utils",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.9",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -43,36 +43,36 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/dev-utils": "^0.4.6",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/lodash": "4.14.104",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^2.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"sinon": "^4.0.0",
|
||||
"chai": "4.1.2",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"chai-bignumber": "2.0.1",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"shx": "0.2.2",
|
||||
"sinon": "4.4.9",
|
||||
"tslint": "5.8.0",
|
||||
"typedoc": "0xProject/typedoc",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/assert": "^0.2.10",
|
||||
"@0xproject/json-schemas": "^0.7.24",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"@types/node": "^8.0.53",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereumjs-abi": "^0.6.4",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.4"
|
||||
"@0xproject/assert": "^0.2.14",
|
||||
"@0xproject/json-schemas": "^0.8.3",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"@types/node": "9.6.0",
|
||||
"bn.js": "4.11.7",
|
||||
"ethereumjs-abi": "0.6.5",
|
||||
"ethereumjs-util": "5.1.5",
|
||||
"lodash": "4.17.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -99,7 +99,7 @@ function parseSignatureHexAsVRS(signatureHex: string): ECSignature {
|
||||
// HACK: Sometimes v is returned as [0, 1] and sometimes as [27, 28]
|
||||
// If it is returned as [0, 1], add 27 to both so it becomes [27, 28]
|
||||
const lowestValidV = 27;
|
||||
const isProperlyFormattedV = v < lowestValidV;
|
||||
const isProperlyFormattedV = v >= lowestValidV;
|
||||
if (!isProperlyFormattedV) {
|
||||
v += lowestValidV;
|
||||
}
|
||||
|
@@ -1,4 +1,63 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Switch out simple getLogs polling with ethereumjs-blockstream",
|
||||
"pr": 825
|
||||
},
|
||||
{
|
||||
"note": "Do not stop subscription if error is encountered",
|
||||
"pr": 825
|
||||
}
|
||||
],
|
||||
"timestamp": 1531149657
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527617805,
|
||||
"version": "0.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527617227,
|
||||
"version": "0.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527616612,
|
||||
"version": "0.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1527008794,
|
||||
"version": "0.0.2",
|
||||
|
@@ -5,6 +5,31 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.8 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.7 - _July 9, 2018_
|
||||
|
||||
* Switch out simple getLogs polling with ethereumjs-blockstream (#825)
|
||||
* Do not stop subscription if error is encountered (#825)
|
||||
|
||||
## v0.0.6 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.5 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.4 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.3 - _May 29, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.2 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/order-watcher",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.8",
|
||||
"description": "An order watcher daemon that watches for order validity",
|
||||
"keywords": [
|
||||
"0x",
|
||||
@@ -28,13 +28,7 @@
|
||||
},
|
||||
"config": {
|
||||
"compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry",
|
||||
"contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy 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 MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -45,50 +39,52 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/abi-gen": "^0.3.0",
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/migrations": "^0.0.6",
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/sol-compiler": "^0.5.0",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@types/bintrees": "^1.0.2",
|
||||
"@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",
|
||||
"@types/bintrees": "1.0.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/sinon": "^2.2.2",
|
||||
"awesome-typescript-loader": "^3.1.3",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^2.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"json-loader": "^0.5.4",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"opn-cli": "^3.1.0",
|
||||
"prettier": "^1.11.1",
|
||||
"shx": "^0.2.2",
|
||||
"sinon": "^4.0.0",
|
||||
"source-map-support": "^0.5.0",
|
||||
"@types/mocha": "2.2.48",
|
||||
"@types/node": "9.6.0",
|
||||
"@types/sinon": "2.3.7",
|
||||
"awesome-typescript-loader": "3.5.0",
|
||||
"chai": "4.1.2",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"chai-bignumber": "2.0.1",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"json-loader": "0.5.7",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"opn-cli": "3.1.0",
|
||||
"prettier": "1.12.1",
|
||||
"shx": "0.2.2",
|
||||
"sinon": "4.4.9",
|
||||
"source-map-support": "0.5.4",
|
||||
"tslint": "5.8.0",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/assert": "^0.2.10",
|
||||
"@0xproject/base-contract": "^0.3.2",
|
||||
"@0xproject/contract-wrappers": "^0.0.2",
|
||||
"@0xproject/fill-scenarios": "^0.0.2",
|
||||
"@0xproject/json-schemas": "^0.7.24",
|
||||
"@0xproject/order-utils": "^0.0.5",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"bintrees": "^1.0.2",
|
||||
"ethers": "^3.0.15",
|
||||
"lodash": "^4.17.4"
|
||||
"@0xproject/assert": "^0.2.14",
|
||||
"@0xproject/base-contract": "^0.3.6",
|
||||
"@0xproject/contract-wrappers": "^0.1.1",
|
||||
"@0xproject/fill-scenarios": "^0.0.6",
|
||||
"@0xproject/json-schemas": "^0.8.3",
|
||||
"@0xproject/order-utils": "^0.0.9",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@0xproject/web3-wrapper": "^0.7.3",
|
||||
"bintrees": "1.0.2",
|
||||
"ethereum-types": "^0.0.2",
|
||||
"ethereumjs-blockstream": "5.0.0",
|
||||
"ethers": "3.0.22",
|
||||
"lodash": "4.17.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { BlockParamLiteral, LogEntry } from '@0xproject/types';
|
||||
import { intervalUtils } from '@0xproject/utils';
|
||||
import { intervalUtils, logUtils } from '@0xproject/utils';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import { Block, BlockAndLogStreamer, Log } from 'ethereumjs-blockstream';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { EventWatcherCallback, OrderWatcherError } from '../types';
|
||||
@@ -19,81 +20,111 @@ enum LogEventState {
|
||||
*/
|
||||
export class EventWatcher {
|
||||
private _web3Wrapper: Web3Wrapper;
|
||||
private _blockAndLogStreamerIfExists: BlockAndLogStreamer<Block, Log> | undefined;
|
||||
private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer;
|
||||
private _onLogAddedSubscriptionToken: string | undefined;
|
||||
private _onLogRemovedSubscriptionToken: string | undefined;
|
||||
private _pollingIntervalMs: number;
|
||||
private _intervalIdIfExists?: NodeJS.Timer;
|
||||
private _lastEvents: LogEntry[] = [];
|
||||
private _stateLayer: BlockParamLiteral;
|
||||
private _isVerbose: boolean;
|
||||
constructor(
|
||||
web3Wrapper: Web3Wrapper,
|
||||
pollingIntervalIfExistsMs: undefined | number,
|
||||
stateLayer: BlockParamLiteral = BlockParamLiteral.Latest,
|
||||
isVerbose: boolean,
|
||||
) {
|
||||
this._isVerbose = isVerbose;
|
||||
this._web3Wrapper = web3Wrapper;
|
||||
this._stateLayer = stateLayer;
|
||||
this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs)
|
||||
? DEFAULT_EVENT_POLLING_INTERVAL_MS
|
||||
: pollingIntervalIfExistsMs;
|
||||
this._blockAndLogStreamerIfExists = undefined;
|
||||
this._blockAndLogStreamIntervalIfExists = undefined;
|
||||
this._onLogAddedSubscriptionToken = undefined;
|
||||
this._onLogRemovedSubscriptionToken = undefined;
|
||||
}
|
||||
public subscribe(callback: EventWatcherCallback): void {
|
||||
assert.isFunction('callback', callback);
|
||||
if (!_.isUndefined(this._intervalIdIfExists)) {
|
||||
if (!_.isUndefined(this._blockAndLogStreamIntervalIfExists)) {
|
||||
throw new Error(OrderWatcherError.SubscriptionAlreadyPresent);
|
||||
}
|
||||
this._intervalIdIfExists = intervalUtils.setAsyncExcludingInterval(
|
||||
this._pollForBlockchainEventsAsync.bind(this, callback),
|
||||
this._pollingIntervalMs,
|
||||
(err: Error) => {
|
||||
this.unsubscribe();
|
||||
callback(err);
|
||||
},
|
||||
);
|
||||
this._startBlockAndLogStream(callback);
|
||||
}
|
||||
public unsubscribe(): void {
|
||||
this._lastEvents = [];
|
||||
if (!_.isUndefined(this._intervalIdIfExists)) {
|
||||
intervalUtils.clearAsyncExcludingInterval(this._intervalIdIfExists);
|
||||
delete this._intervalIdIfExists;
|
||||
if (_.isUndefined(this._blockAndLogStreamIntervalIfExists)) {
|
||||
throw new Error(OrderWatcherError.SubscriptionNotFound);
|
||||
}
|
||||
this._stopBlockAndLogStream();
|
||||
}
|
||||
private async _pollForBlockchainEventsAsync(callback: EventWatcherCallback): Promise<void> {
|
||||
const pendingEvents = await this._getEventsAsync();
|
||||
if (_.isUndefined(pendingEvents)) {
|
||||
// HACK: This should never happen, but happens frequently on CI due to a ganache bug
|
||||
return;
|
||||
private _startBlockAndLogStream(callback: EventWatcherCallback): void {
|
||||
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
|
||||
throw new Error(OrderWatcherError.SubscriptionAlreadyPresent);
|
||||
}
|
||||
if (pendingEvents.length === 0) {
|
||||
// HACK: Sometimes when node rebuilds the pending block we get back the empty result.
|
||||
// We don't want to emit a lot of removal events and bring them back after a couple of miliseconds,
|
||||
// that's why we just ignore those cases.
|
||||
return;
|
||||
}
|
||||
const removedEvents = _.differenceBy(this._lastEvents, pendingEvents, JSON.stringify);
|
||||
const newEvents = _.differenceBy(pendingEvents, this._lastEvents, JSON.stringify);
|
||||
await this._emitDifferencesAsync(removedEvents, LogEventState.Removed, callback);
|
||||
await this._emitDifferencesAsync(newEvents, LogEventState.Added, callback);
|
||||
this._lastEvents = pendingEvents;
|
||||
this._blockAndLogStreamerIfExists = new BlockAndLogStreamer(
|
||||
this._web3Wrapper.getBlockAsync.bind(this._web3Wrapper),
|
||||
this._web3Wrapper.getLogsAsync.bind(this._web3Wrapper),
|
||||
this._onBlockAndLogStreamerError.bind(this),
|
||||
);
|
||||
const catchAllLogFilter = {};
|
||||
this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter);
|
||||
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
|
||||
this._reconcileBlockAsync.bind(this),
|
||||
this._pollingIntervalMs,
|
||||
this._onBlockAndLogStreamerError.bind(this),
|
||||
);
|
||||
let isRemoved = false;
|
||||
this._onLogAddedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogAdded(
|
||||
this._onLogStateChangedAsync.bind(this, callback, isRemoved),
|
||||
);
|
||||
isRemoved = true;
|
||||
this._onLogRemovedSubscriptionToken = this._blockAndLogStreamerIfExists.subscribeToOnLogRemoved(
|
||||
this._onLogStateChangedAsync.bind(this, callback, isRemoved),
|
||||
);
|
||||
}
|
||||
private async _getEventsAsync(): Promise<LogEntry[]> {
|
||||
const eventFilter = {
|
||||
fromBlock: this._stateLayer,
|
||||
toBlock: this._stateLayer,
|
||||
};
|
||||
const events = await this._web3Wrapper.getLogsAsync(eventFilter);
|
||||
return events;
|
||||
private _stopBlockAndLogStream(): void {
|
||||
if (_.isUndefined(this._blockAndLogStreamerIfExists)) {
|
||||
throw new Error(OrderWatcherError.SubscriptionNotFound);
|
||||
}
|
||||
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogAdded(this._onLogAddedSubscriptionToken as string);
|
||||
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogRemoved(this._onLogRemovedSubscriptionToken as string);
|
||||
intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamIntervalIfExists as NodeJS.Timer);
|
||||
delete this._blockAndLogStreamerIfExists;
|
||||
delete this._blockAndLogStreamIntervalIfExists;
|
||||
}
|
||||
private async _onLogStateChangedAsync(
|
||||
callback: EventWatcherCallback,
|
||||
isRemoved: boolean,
|
||||
log: LogEntry,
|
||||
): Promise<void> {
|
||||
await this._emitDifferencesAsync(log, isRemoved ? LogEventState.Removed : LogEventState.Added, callback);
|
||||
}
|
||||
private async _reconcileBlockAsync(): Promise<void> {
|
||||
const latestBlock = await this._web3Wrapper.getBlockAsync(BlockParamLiteral.Latest);
|
||||
// We need to coerce to Block type cause Web3.Block includes types for mempool blocks
|
||||
if (!_.isUndefined(this._blockAndLogStreamerIfExists)) {
|
||||
// If we clear the interval while fetching the block - this._blockAndLogStreamer will be undefined
|
||||
await this._blockAndLogStreamerIfExists.reconcileNewBlock((latestBlock as any) as Block);
|
||||
}
|
||||
}
|
||||
private async _emitDifferencesAsync(
|
||||
logs: LogEntry[],
|
||||
log: LogEntry,
|
||||
logEventState: LogEventState,
|
||||
callback: EventWatcherCallback,
|
||||
): Promise<void> {
|
||||
for (const log of logs) {
|
||||
const logEvent = {
|
||||
removed: logEventState === LogEventState.Removed,
|
||||
...log,
|
||||
};
|
||||
if (!_.isUndefined(this._intervalIdIfExists)) {
|
||||
callback(null, logEvent);
|
||||
}
|
||||
const logEvent = {
|
||||
removed: logEventState === LogEventState.Removed,
|
||||
...log,
|
||||
};
|
||||
if (!_.isUndefined(this._blockAndLogStreamIntervalIfExists)) {
|
||||
callback(null, logEvent);
|
||||
}
|
||||
}
|
||||
private _onBlockAndLogStreamerError(err: Error): void {
|
||||
// Since Blockstream errors are all recoverable, we simply log them if the verbose
|
||||
// config is passed in.
|
||||
if (this._isVerbose) {
|
||||
logUtils.warn(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@ export class ExpirationWatcher {
|
||||
private _expirationMarginMs: number;
|
||||
private _orderExpirationCheckingIntervalIdIfExists?: NodeJS.Timer;
|
||||
constructor(expirationMarginIfExistsMs?: number, orderExpirationCheckingIntervalIfExistsMs?: number) {
|
||||
this._orderExpirationCheckingIntervalMs =
|
||||
orderExpirationCheckingIntervalIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS;
|
||||
this._expirationMarginMs = expirationMarginIfExistsMs || DEFAULT_EXPIRATION_MARGIN_MS;
|
||||
this._orderExpirationCheckingIntervalMs =
|
||||
expirationMarginIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS;
|
||||
|
@@ -14,7 +14,7 @@ import {
|
||||
Provider,
|
||||
SignedOrder,
|
||||
} from '@0xproject/types';
|
||||
import { AbiDecoder, intervalUtils } from '@0xproject/utils';
|
||||
import { errorUtils, intervalUtils } from '@0xproject/utils';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
@@ -39,7 +39,6 @@ import {
|
||||
} from '../generated_contract_wrappers/token';
|
||||
import { OnOrderStateChangeCallback, OrderWatcherConfig, OrderWatcherError } from '../types';
|
||||
import { assert } from '../utils/assert';
|
||||
import { utils } from '../utils/utils';
|
||||
|
||||
import { EventWatcher } from './event_watcher';
|
||||
import { ExpirationWatcher } from './expiration_watcher';
|
||||
@@ -62,6 +61,7 @@ interface OrderStateByOrderHash {
|
||||
|
||||
// tslint:disable-next-line:custom-no-magic-numbers
|
||||
const DEFAULT_CLEANUP_JOB_INTERVAL_MS = 1000 * 60 * 60; // 1h
|
||||
const STATE_LAYER = BlockParamLiteral.Latest;
|
||||
|
||||
/**
|
||||
* This class includes all the functionality related to watching a set of orders
|
||||
@@ -92,16 +92,15 @@ export class OrderWatcher {
|
||||
});
|
||||
this._contractWrappers = new ContractWrappers(provider, { networkId });
|
||||
const pollingIntervalIfExistsMs = _.isUndefined(config) ? undefined : config.eventPollingIntervalMs;
|
||||
const stateLayer =
|
||||
_.isUndefined(config) || _.isUndefined(config.stateLayer) ? BlockParamLiteral.Latest : config.stateLayer;
|
||||
this._eventWatcher = new EventWatcher(this._web3Wrapper, pollingIntervalIfExistsMs, stateLayer);
|
||||
const isVerbose = !_.isUndefined(config) && !_.isUndefined(config.isVerbose) ? config.isVerbose : false;
|
||||
this._eventWatcher = new EventWatcher(this._web3Wrapper, pollingIntervalIfExistsMs, STATE_LAYER, isVerbose);
|
||||
this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore(
|
||||
this._contractWrappers.token,
|
||||
stateLayer,
|
||||
STATE_LAYER,
|
||||
);
|
||||
this._orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(
|
||||
this._contractWrappers.exchange,
|
||||
stateLayer,
|
||||
STATE_LAYER,
|
||||
);
|
||||
this._orderStateUtils = new OrderStateUtils(
|
||||
this._balanceAndProxyAllowanceLazyStore,
|
||||
@@ -237,7 +236,6 @@ export class OrderWatcher {
|
||||
if (!_.isNull(err)) {
|
||||
if (!_.isUndefined(this._callbackIfExists)) {
|
||||
this._callbackIfExists(err);
|
||||
this.unsubscribe();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -344,7 +342,7 @@ export class OrderWatcher {
|
||||
return; // noop
|
||||
|
||||
default:
|
||||
throw utils.spawnSwitchErr('decodedLog.event', decodedLog.event);
|
||||
throw errorUtils.spawnSwitchErr('decodedLog.event', decodedLog.event);
|
||||
}
|
||||
}
|
||||
private async _emitRevalidateOrdersAsync(orderHashes: string[]): Promise<void> {
|
||||
|
@@ -1,18 +1,4 @@
|
||||
import { BigNumber } from '@0xproject/utils';
|
||||
|
||||
import {
|
||||
BlockParam,
|
||||
BlockParamLiteral,
|
||||
ContractAbi,
|
||||
ContractEventArg,
|
||||
ExchangeContractErrs,
|
||||
FilterObject,
|
||||
LogEntryEvent,
|
||||
LogWithDecodedArgs,
|
||||
Order,
|
||||
OrderState,
|
||||
SignedOrder,
|
||||
} from '@0xproject/types';
|
||||
import { BlockParamLiteral, LogEntryEvent, OrderState } from '@0xproject/types';
|
||||
|
||||
export enum OrderWatcherError {
|
||||
SubscriptionAlreadyPresent = 'SUBSCRIPTION_ALREADY_PRESENT',
|
||||
@@ -34,7 +20,7 @@ export interface OrderWatcherConfig {
|
||||
eventPollingIntervalMs?: number;
|
||||
expirationMarginMs?: number;
|
||||
cleanupJobIntervalMs?: number;
|
||||
stateLayer: BlockParamLiteral;
|
||||
isVerbose?: boolean;
|
||||
}
|
||||
|
||||
export type OnOrderStateChangeCallback = (err: Error | null, orderState?: OrderState) => void;
|
||||
|
@@ -1,12 +1,10 @@
|
||||
import { assert as sharedAssert } from '@0xproject/assert';
|
||||
// We need those two unused imports because they're actually used by sharedAssert which gets injected here
|
||||
// tslint:disable-next-line:no-unused-variable
|
||||
// tslint:disable:no-unused-variable
|
||||
import { Schema } from '@0xproject/json-schemas';
|
||||
// tslint:disable-next-line:no-unused-variable
|
||||
import { ECSignature } from '@0xproject/types';
|
||||
import { BigNumber } from '@0xproject/utils';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import * as _ from 'lodash';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
import { isValidSignature } from '@0xproject/order-utils';
|
||||
|
||||
|
@@ -1,9 +1,6 @@
|
||||
import { BigNumber } from '@0xproject/utils';
|
||||
|
||||
export const utils = {
|
||||
spawnSwitchErr(name: string, value: any): Error {
|
||||
return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
|
||||
},
|
||||
getCurrentUnixTimestampSec(): BigNumber {
|
||||
const milisecondsInASecond = 1000;
|
||||
return new BigNumber(Date.now() / milisecondsInASecond).round();
|
||||
|
@@ -1,127 +0,0 @@
|
||||
import { callbackErrorReporter, web3Factory } from '@0xproject/dev-utils';
|
||||
import { DoneCallback, LogEntry, LogEntryEvent } from '@0xproject/types';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import * as chai from 'chai';
|
||||
import * as _ from 'lodash';
|
||||
import 'make-promises-safe';
|
||||
import 'mocha';
|
||||
import * as Sinon from 'sinon';
|
||||
|
||||
import { EventWatcher } from '../src/order_watcher/event_watcher';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
import { provider } from './utils/web3_wrapper';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
describe('EventWatcher', () => {
|
||||
let stubs: Sinon.SinonStub[] = [];
|
||||
let eventWatcher: EventWatcher;
|
||||
let web3Wrapper: Web3Wrapper;
|
||||
const logA: LogEntry = {
|
||||
address: '0x71d271f8b14adef568f8f28f1587ce7271ac4ca5',
|
||||
blockHash: null,
|
||||
blockNumber: null,
|
||||
data: '',
|
||||
logIndex: null,
|
||||
topics: [],
|
||||
transactionHash: '0x004881d38cd4a8f72f1a0d68c8b9b8124504706041ff37019c1d1ed6bfda8e17',
|
||||
transactionIndex: 0,
|
||||
};
|
||||
const logB: LogEntry = {
|
||||
address: '0x8d12a197cb00d4747a1fe03395095ce2a5cc6819',
|
||||
blockHash: null,
|
||||
blockNumber: null,
|
||||
data: '',
|
||||
logIndex: null,
|
||||
topics: ['0xf341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567'],
|
||||
transactionHash: '0x01ef3c048b18d9b09ea195b4ed94cf8dd5f3d857a1905ff886b152cfb1166f25',
|
||||
transactionIndex: 0,
|
||||
};
|
||||
const logC: LogEntry = {
|
||||
address: '0x1d271f8b174adef58f1587ce68f8f27271ac4ca5',
|
||||
blockHash: null,
|
||||
blockNumber: null,
|
||||
data: '',
|
||||
logIndex: null,
|
||||
topics: ['0xf341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567'],
|
||||
transactionHash: '0x01ef3c048b18d9b09ea195b4ed94cf8dd5f3d857a1905ff886b152cfb1166f25',
|
||||
transactionIndex: 0,
|
||||
};
|
||||
before(async () => {
|
||||
const pollingIntervalMs = 10;
|
||||
web3Wrapper = new Web3Wrapper(provider);
|
||||
eventWatcher = new EventWatcher(web3Wrapper, pollingIntervalMs);
|
||||
});
|
||||
afterEach(() => {
|
||||
// clean up any stubs after the test has completed
|
||||
_.each(stubs, s => s.restore());
|
||||
stubs = [];
|
||||
eventWatcher.unsubscribe();
|
||||
});
|
||||
it('correctly emits initial log events', (done: DoneCallback) => {
|
||||
const logs: LogEntry[] = [logA, logB];
|
||||
const expectedLogEvents = [
|
||||
{
|
||||
removed: false,
|
||||
...logA,
|
||||
},
|
||||
{
|
||||
removed: false,
|
||||
...logB,
|
||||
},
|
||||
];
|
||||
const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync');
|
||||
getLogsStub.onCall(0).returns(logs);
|
||||
stubs.push(getLogsStub);
|
||||
const expectedToBeCalledOnce = false;
|
||||
const callback = callbackErrorReporter.reportNodeCallbackErrors(done, expectedToBeCalledOnce)(
|
||||
(event: LogEntryEvent) => {
|
||||
const expectedLogEvent = expectedLogEvents.shift();
|
||||
expect(event).to.be.deep.equal(expectedLogEvent);
|
||||
if (_.isEmpty(expectedLogEvents)) {
|
||||
done();
|
||||
}
|
||||
},
|
||||
);
|
||||
eventWatcher.subscribe(callback);
|
||||
});
|
||||
it('correctly computes the difference and emits only changes', (done: DoneCallback) => {
|
||||
const initialLogs: LogEntry[] = [logA, logB];
|
||||
const changedLogs: LogEntry[] = [logA, logC];
|
||||
const expectedLogEvents = [
|
||||
{
|
||||
removed: false,
|
||||
...logA,
|
||||
},
|
||||
{
|
||||
removed: false,
|
||||
...logB,
|
||||
},
|
||||
{
|
||||
removed: true,
|
||||
...logB,
|
||||
},
|
||||
{
|
||||
removed: false,
|
||||
...logC,
|
||||
},
|
||||
];
|
||||
const getLogsStub = Sinon.stub(web3Wrapper, 'getLogsAsync');
|
||||
getLogsStub.onCall(0).returns(initialLogs);
|
||||
getLogsStub.onCall(1).returns(changedLogs);
|
||||
stubs.push(getLogsStub);
|
||||
const expectedToBeCalledOnce = false;
|
||||
const callback = callbackErrorReporter.reportNodeCallbackErrors(done, expectedToBeCalledOnce)(
|
||||
(event: LogEntryEvent) => {
|
||||
const expectedLogEvent = expectedLogEvents.shift();
|
||||
expect(event).to.be.deep.equal(expectedLogEvent);
|
||||
if (_.isEmpty(expectedLogEvents)) {
|
||||
done();
|
||||
}
|
||||
},
|
||||
);
|
||||
eventWatcher.subscribe(callback);
|
||||
});
|
||||
});
|
@@ -1,16 +1,14 @@
|
||||
import { ContractWrappers } from '@0xproject/contract-wrappers';
|
||||
import { BlockchainLifecycle, callbackErrorReporter, devConstants } from '@0xproject/dev-utils';
|
||||
import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
|
||||
import { FillScenarios } from '@0xproject/fill-scenarios';
|
||||
import { getOrderHashHex } from '@0xproject/order-utils';
|
||||
import { DoneCallback, Token } from '@0xproject/types';
|
||||
import { BigNumber } from '@0xproject/utils';
|
||||
import * as chai from 'chai';
|
||||
import * as _ from 'lodash';
|
||||
import 'make-promises-safe';
|
||||
import 'mocha';
|
||||
import * as Sinon from 'sinon';
|
||||
|
||||
import { artifacts } from '../src/artifacts';
|
||||
import { ExpirationWatcher } from '../src/order_watcher/expiration_watcher';
|
||||
import { utils } from '../src/utils/utils';
|
||||
|
||||
@@ -108,7 +106,7 @@ describe('ExpirationWatcher', () => {
|
||||
);
|
||||
const orderHash = getOrderHashHex(signedOrder);
|
||||
expirationWatcher.addOrder(orderHash, signedOrder.expirationUnixTimestampSec.times(MILISECONDS_IN_SECOND));
|
||||
const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done)(async (hash: string) => {
|
||||
const callbackAsync = callbackErrorReporter.reportNoErrorCallbackErrors(done)(async (_hash: string) => {
|
||||
done(new Error('Emitted expiration went before the order actually expired'));
|
||||
});
|
||||
expirationWatcher.subscribe(callbackAsync);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// tslint:disable:no-unnecessary-type-assertion
|
||||
import { ContractWrappers } from '@0xproject/contract-wrappers';
|
||||
import { BlockchainLifecycle, callbackErrorReporter, devConstants } from '@0xproject/dev-utils';
|
||||
import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils';
|
||||
import { FillScenarios } from '@0xproject/fill-scenarios';
|
||||
import { getOrderHashHex } from '@0xproject/order-utils';
|
||||
import {
|
||||
@@ -15,7 +16,6 @@ import { BigNumber } from '@0xproject/utils';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import * as chai from 'chai';
|
||||
import * as _ from 'lodash';
|
||||
import 'make-promises-safe';
|
||||
import 'mocha';
|
||||
|
||||
import { OrderWatcher } from '../src/order_watcher/order_watcher';
|
||||
@@ -46,15 +46,15 @@ describe('OrderWatcher', () => {
|
||||
let taker: string;
|
||||
let signedOrder: SignedOrder;
|
||||
let orderWatcher: OrderWatcher;
|
||||
const config = {
|
||||
networkId: constants.TESTRPC_NETWORK_ID,
|
||||
};
|
||||
const decimals = constants.ZRX_DECIMALS;
|
||||
const fillableAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5), decimals);
|
||||
before(async () => {
|
||||
contractWrappers = new ContractWrappers(provider, config);
|
||||
const networkId = await web3Wrapper.getNetworkIdAsync();
|
||||
orderWatcher = new OrderWatcher(provider, constants.TESTRPC_NETWORK_ID);
|
||||
const config = {
|
||||
networkId,
|
||||
};
|
||||
contractWrappers = new ContractWrappers(provider, config);
|
||||
orderWatcher = new OrderWatcher(provider, networkId);
|
||||
exchangeContractAddress = contractWrappers.exchange.getContractAddress();
|
||||
userAddresses = await web3Wrapper.getAvailableAddressesAsync();
|
||||
[, maker, taker] = userAddresses;
|
||||
@@ -157,7 +157,7 @@ describe('OrderWatcher', () => {
|
||||
fillableAmount,
|
||||
);
|
||||
orderWatcher.addOrder(signedOrder);
|
||||
const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => {
|
||||
const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((_orderState: OrderState) => {
|
||||
throw new Error('OrderState callback fired for irrelevant order');
|
||||
});
|
||||
orderWatcher.subscribe(callback);
|
||||
|
@@ -1 +1 @@
|
||||
Welcome to the [Web3Wrapper](https://github.com/0xProject/0x-monorepo/packages/web3-wrapper) documentation! Web3Wrapper is a convenience wrapper around Web3.js, adding support for promises and other niceties.
|
||||
Welcome to the [Web3Wrapper](https://github.com/0xProject/0x-monorepo/tree/development/packages/web3-wrapper) documentation! Web3-wrapper is a JSON-RPC client for Ethereum nodes. It is a type-safe alternative to [Web3.js](https://github.com/ethereum/web3.js/) written in TypeScript.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@0xproject/react-docs-example",
|
||||
"version": "0.0.12",
|
||||
"version": "0.0.15",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -26,36 +26,36 @@
|
||||
"url": "https://github.com/0xProject/0x-monorepo.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/material-ui": "0.18.0",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/node": "9.6.0",
|
||||
"@types/react": "16.3.13",
|
||||
"@types/react-dom": "^16.0.3",
|
||||
"@types/react-dom": "16.0.4",
|
||||
"@types/react-tap-event-plugin": "0.0.30",
|
||||
"awesome-typescript-loader": "^3.1.3",
|
||||
"copyfiles": "^1.2.0",
|
||||
"css-loader": "^0.28.9",
|
||||
"json-loader": "^0.5.4",
|
||||
"less": "^2.7.2",
|
||||
"less-loader": "^2.2.3",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"raw-loader": "^0.5.1",
|
||||
"shx": "^0.2.2",
|
||||
"source-map-loader": "^0.2.3",
|
||||
"style-loader": "^0.20.2",
|
||||
"tslint": "^5.9.1",
|
||||
"awesome-typescript-loader": "3.5.0",
|
||||
"copyfiles": "1.2.0",
|
||||
"css-loader": "0.28.11",
|
||||
"json-loader": "0.5.7",
|
||||
"less": "2.7.3",
|
||||
"less-loader": "2.2.3",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"raw-loader": "0.5.1",
|
||||
"shx": "0.2.2",
|
||||
"source-map-loader": "0.2.3",
|
||||
"style-loader": "0.20.3",
|
||||
"tslint": "5.9.1",
|
||||
"typescript": "2.7.1",
|
||||
"webpack": "^3.11.0",
|
||||
"webpack-dev-server": "^2.11.1"
|
||||
"webpack": "3.11.0",
|
||||
"webpack-dev-server": "2.11.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/react-docs": "^0.0.12",
|
||||
"basscss": "^8.0.3",
|
||||
"lodash": "^4.17.4",
|
||||
"material-ui": "^0.17.1",
|
||||
"@0xproject/react-docs": "^0.0.16",
|
||||
"basscss": "8.0.4",
|
||||
"lodash": "4.17.10",
|
||||
"material-ui": "0.17.4",
|
||||
"react": "15.6.1",
|
||||
"react-dom": "15.6.1",
|
||||
"react-tap-event-plugin": "^2.0.1"
|
||||
"react-tap-event-plugin": "2.0.1"
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.0.16",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.0.15",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.0.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.0.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"timestamp": 1527009133,
|
||||
"version": "0.0.12",
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.16 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.15 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.14 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.13 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.0.12 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.11 - _May 4, 2018_
|
||||
## v0.0.11 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/react-docs",
|
||||
"version": "0.0.12",
|
||||
"version": "0.0.16",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -25,33 +25,33 @@
|
||||
"url": "https://github.com/0xProject/0x-monorepo.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"copyfiles": "^1.2.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"shx": "^0.2.2",
|
||||
"tslint": "^5.9.1",
|
||||
"@0xproject/dev-utils": "^0.4.6",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"copyfiles": "1.2.0",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.9.1",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/react-shared": "^0.1.7",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/react-shared": "^0.2.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/material-ui": "0.18.0",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/node": "9.6.0",
|
||||
"@types/react": "16.3.13",
|
||||
"@types/react-dom": "^16.0.3",
|
||||
"@types/react-dom": "16.0.4",
|
||||
"@types/react-scroll": "0.0.31",
|
||||
"basscss": "^8.0.3",
|
||||
"compare-versions": "^3.0.1",
|
||||
"lodash": "^4.17.4",
|
||||
"material-ui": "^0.17.1",
|
||||
"basscss": "8.0.4",
|
||||
"compare-versions": "3.1.0",
|
||||
"lodash": "4.17.10",
|
||||
"material-ui": "0.17.4",
|
||||
"react": "15.6.1",
|
||||
"react-dom": "15.6.1",
|
||||
"react-markdown": "^3.2.2",
|
||||
"react-scroll": "^1.5.2",
|
||||
"react-tooltip": "^3.2.7"
|
||||
"react-markdown": "3.2.2",
|
||||
"react-scroll": "1.7.7",
|
||||
"react-tooltip": "3.4.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.2.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.2.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"timestamp": 1527009133,
|
||||
"version": "0.1.7",
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.2.3 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.2 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.1 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.2.0 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.1.7 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.1.6 - _May 4, 2018_
|
||||
## v0.1.6 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/react-shared",
|
||||
"version": "0.1.7",
|
||||
"version": "0.2.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -25,32 +25,32 @@
|
||||
"url": "https://github.com/0xProject/0x-monorepo.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"copyfiles": "^1.2.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"shx": "^0.2.2",
|
||||
"tslint": "^5.9.1",
|
||||
"@0xproject/dev-utils": "^0.4.6",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"copyfiles": "1.2.0",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.9.1",
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/material-ui": "0.18.0",
|
||||
"@types/node": "^8.0.53",
|
||||
"@types/node": "9.6.0",
|
||||
"@types/react": "16.3.13",
|
||||
"@types/react-dom": "^16.0.3",
|
||||
"@types/react-dom": "16.0.4",
|
||||
"@types/react-scroll": "0.0.31",
|
||||
"basscss": "^8.0.3",
|
||||
"is-mobile": "^0.2.2",
|
||||
"lodash": "^4.17.4",
|
||||
"material-ui": "^0.17.1",
|
||||
"basscss": "8.0.4",
|
||||
"is-mobile": "0.2.2",
|
||||
"lodash": "4.17.10",
|
||||
"material-ui": "0.17.4",
|
||||
"react": "15.6.1",
|
||||
"react-dom": "15.6.1",
|
||||
"react-highlight": "0xproject/react-highlight",
|
||||
"react-markdown": "^3.2.2",
|
||||
"react-scroll": "^1.5.2",
|
||||
"react-tap-event-plugin": "^2.0.1"
|
||||
"react-markdown": "3.2.2",
|
||||
"react-scroll": "1.7.7",
|
||||
"react-tap-event-plugin": "2.0.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.5.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.5.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.5.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.5.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"version": "0.5.0",
|
||||
"changes": [
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.5.4 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.5.3 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.5.2 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.5.1 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.5.0 - _May 22, 2018_
|
||||
|
||||
* Properly export the executable binary (#588)
|
||||
|
||||
## v0.4.3 - _May 4, 2018_
|
||||
## v0.4.3 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/sol-compiler",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,47 +49,47 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md",
|
||||
"devDependencies": {
|
||||
"@0xproject/dev-utils": "^0.4.2",
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@types/mkdirp": "^0.5.2",
|
||||
"@types/require-from-string": "^1.2.0",
|
||||
"@types/semver": "^5.5.0",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"shx": "^0.2.2",
|
||||
"@0xproject/dev-utils": "^0.4.6",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/mkdirp": "0.5.2",
|
||||
"@types/require-from-string": "1.2.0",
|
||||
"@types/semver": "5.5.0",
|
||||
"chai": "4.1.2",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"shx": "0.2.2",
|
||||
"tslint": "5.8.0",
|
||||
"typedoc": "0xProject/typedoc",
|
||||
"types-bn": "^0.0.1",
|
||||
"types-bn": "0.0.1",
|
||||
"typescript": "2.7.1",
|
||||
"web3-typescript-typings": "^0.10.2",
|
||||
"web3-typescript-typings": "0.10.2",
|
||||
"zeppelin-solidity": "1.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0xproject/json-schemas": "^0.7.24",
|
||||
"@0xproject/sol-resolver": "^0.0.5",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"@0xproject/web3-wrapper": "^0.6.4",
|
||||
"@types/yargs": "^11.0.0",
|
||||
"chalk": "^2.3.0",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"isomorphic-fetch": "^2.2.1",
|
||||
"lodash": "^4.17.4",
|
||||
"mkdirp": "^0.5.1",
|
||||
"require-from-string": "^2.0.1",
|
||||
"semver": "^5.5.0",
|
||||
"solc": "^0.4.23",
|
||||
"web3": "^0.20.0",
|
||||
"web3-eth-abi": "^1.0.0-beta.24",
|
||||
"yargs": "^10.0.3"
|
||||
"@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",
|
||||
"@types/yargs": "10.0.2",
|
||||
"chalk": "2.3.2",
|
||||
"ethereumjs-util": "5.1.5",
|
||||
"isomorphic-fetch": "2.2.1",
|
||||
"lodash": "4.17.10",
|
||||
"mkdirp": "0.5.1",
|
||||
"require-from-string": "2.0.1",
|
||||
"semver": "5.5.0",
|
||||
"solc": "0.4.23",
|
||||
"web3": "0.20.6",
|
||||
"web3-eth-abi": "1.0.0-beta.33",
|
||||
"yargs": "11.1.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -32,7 +32,9 @@ const SEPARATOR = ',';
|
||||
.help().argv;
|
||||
const contracts = _.isUndefined(argv.contracts)
|
||||
? undefined
|
||||
: argv.contracts === DEFAULT_CONTRACTS_LIST ? DEFAULT_CONTRACTS_LIST : argv.contracts.split(SEPARATOR);
|
||||
: argv.contracts === DEFAULT_CONTRACTS_LIST
|
||||
? DEFAULT_CONTRACTS_LIST
|
||||
: argv.contracts.split(SEPARATOR);
|
||||
const opts: CompilerOptions = {
|
||||
contractsDir: argv.contractsDir,
|
||||
artifactsDir: argv.artifactsDir,
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531919263,
|
||||
"version": "0.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.1.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"timestamp": 1527009134,
|
||||
"version": "0.0.11",
|
||||
|
@@ -5,11 +5,27 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.1.3 - _July 18, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.1.2 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.1.1 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.1.0 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.0.11 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.10 - _May 4, 2018_
|
||||
## v0.0.10 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0xproject/sol-cov",
|
||||
"version": "0.0.11",
|
||||
"version": "0.1.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -46,34 +46,34 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md",
|
||||
"dependencies": {
|
||||
"@0xproject/subproviders": "^0.10.2",
|
||||
"@0xproject/types": "^0.7.0",
|
||||
"@0xproject/typescript-typings": "^0.3.2",
|
||||
"@0xproject/utils": "^0.6.2",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"glob": "^7.1.2",
|
||||
"istanbul": "^0.4.5",
|
||||
"lodash": "^4.17.4",
|
||||
"mkdirp": "^0.5.1",
|
||||
"semaphore-async-await": "^1.5.1",
|
||||
"solidity-parser-antlr": "^0.2.8"
|
||||
"@0xproject/subproviders": "^0.10.6",
|
||||
"@0xproject/types": "^0.8.2",
|
||||
"@0xproject/typescript-typings": "^0.4.3",
|
||||
"@0xproject/utils": "^0.7.3",
|
||||
"ethereumjs-util": "5.1.5",
|
||||
"glob": "7.1.1",
|
||||
"istanbul": "0.4.5",
|
||||
"lodash": "4.17.10",
|
||||
"mkdirp": "0.5.1",
|
||||
"semaphore-async-await": "1.5.1",
|
||||
"solidity-parser-antlr": "0.2.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0xproject/monorepo-scripts": "^0.1.20",
|
||||
"@0xproject/tslint-config": "^0.4.18",
|
||||
"@types/istanbul": "^0.4.30",
|
||||
"@types/mkdirp": "^0.5.1",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"@types/node": "^8.0.53",
|
||||
"chai": "^4.0.1",
|
||||
"copyfiles": "^1.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^4.0.1",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"shx": "^0.2.2",
|
||||
"sinon": "^4.0.0",
|
||||
"@0xproject/monorepo-scripts": "^0.2.2",
|
||||
"@0xproject/tslint-config": "^0.4.21",
|
||||
"@types/istanbul": "0.4.30",
|
||||
"@types/mkdirp": "0.5.2",
|
||||
"@types/mocha": "2.2.48",
|
||||
"@types/node": "9.6.0",
|
||||
"chai": "4.1.2",
|
||||
"copyfiles": "1.2.0",
|
||||
"dirty-chai": "2.0.1",
|
||||
"make-promises-safe": "1.1.0",
|
||||
"mocha": "4.1.0",
|
||||
"npm-run-all": "4.1.2",
|
||||
"nyc": "11.6.0",
|
||||
"shx": "0.2.2",
|
||||
"sinon": "4.4.9",
|
||||
"tslint": "5.8.0",
|
||||
"typedoc": "0xProject/typedoc",
|
||||
"typescript": "2.7.1"
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1531149657,
|
||||
"version": "0.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1529397769,
|
||||
"version": "0.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Incorrect publish that was unpublished"
|
||||
}
|
||||
],
|
||||
"timestamp": 1527810075
|
||||
},
|
||||
{
|
||||
"timestamp": 1527009133,
|
||||
"version": "0.0.5",
|
||||
|
@@ -5,11 +5,23 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.0.8 - _July 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.7 - _June 19, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.6 - _June 1, 2018_
|
||||
|
||||
* Incorrect publish that was unpublished
|
||||
|
||||
## v0.0.5 - _May 22, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.0.4 - _May 4, 2018_
|
||||
## v0.0.4 - _May 5, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user