Merge pull request #358 from 0xProject/feature/build_watch

Add build:watch command to all TS packages
This commit is contained in:
Leonid 2018-02-05 12:03:36 +01:00 committed by GitHub
commit c7ad6ebad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 100 additions and 24 deletions

View File

@ -81,6 +81,12 @@ Build all packages
yarn lerna:run build
```
Continuously rebuild on exchange
```bash
yarn dev
```
### Lint
Lint all packages

View File

@ -3,6 +3,7 @@
"name": "0x.js",
"workspaces": ["packages/*"],
"scripts": {
"dev": "lerna run --parallel build:watch",
"testrpc": "testrpc -p 8545 --networkId 50 -m \"${npm_package_config_mnemonic}\"",
"prettier": "prettier --write '**/*.{ts,tsx,json,md}' --config .prettierrc",
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc",

View File

@ -12,6 +12,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"prebuild": "run-s clean generate_contract_wrappers",
"build": "run-p build:umd:prod build:commonjs; exit 0;",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
@ -73,7 +74,7 @@
"truffle-hdwallet-provider": "^0.0.3",
"tslint": "5.8.0",
"typedoc": "~0.8.0",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-provider-engine": "^13.0.1",
"web3-typescript-typings": "^0.9.8",
"webpack": "^3.1.0"

View File

@ -34,8 +34,8 @@ export class ContractWrapper {
protected _web3Wrapper: Web3Wrapper;
private _networkId: number;
private _abiDecoder?: AbiDecoder;
private _blockAndLogStreamerIfExists: BlockAndLogStreamer | undefined;
private _blockAndLogStreamInterval: NodeJS.Timer;
private _blockAndLogStreamerIfExists?: BlockAndLogStreamer;
private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer;
private _filters: { [filterToken: string]: Web3.FilterObject };
private _filterCallbacks: {
[filterToken: string]: EventCallback<ContractEventArgs>;
@ -162,7 +162,7 @@ export class ContractWrapper {
);
const catchAllLogFilter = {};
this._blockAndLogStreamerIfExists.addLogFilter(catchAllLogFilter);
this._blockAndLogStreamInterval = intervalUtils.setAsyncExcludingInterval(
this._blockAndLogStreamIntervalIfExists = intervalUtils.setAsyncExcludingInterval(
this._reconcileBlockAsync.bind(this),
constants.DEFAULT_BLOCK_POLLING_INTERVAL,
this._onReconcileBlockError.bind(this),
@ -191,7 +191,7 @@ export class ContractWrapper {
}
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogAdded(this._onLogAddedSubscriptionToken as string);
this._blockAndLogStreamerIfExists.unsubscribeFromOnLogRemoved(this._onLogRemovedSubscriptionToken as string);
intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamInterval);
intervalUtils.clearAsyncExcludingInterval(this._blockAndLogStreamIntervalIfExists as NodeJS.Timer);
delete this._blockAndLogStreamerIfExists;
}
private async _reconcileBlockAsync(): Promise<void> {

View File

@ -5,6 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"lint": "tslint --project . 'src/**/*.ts'",
"clean": "shx rm -rf lib",
"build": "tsc"
@ -42,7 +43,7 @@
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8"
}
}

View File

@ -5,6 +5,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"build": "tsc",
"clean": "shx rm -rf _bundles lib test_temp",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
@ -34,7 +35,7 @@
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1"
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/json-schemas": "^0.7.7",

View File

@ -12,6 +12,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"build": "tsc",
"clean": "shx rm -rf _bundles lib test_temp",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
@ -63,7 +64,7 @@
"shx": "^0.2.2",
"tslint": "5.8.0",
"typedoc": "~0.8.0",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8"
}
}

View File

@ -38,6 +38,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Clean
```bash

View File

@ -8,6 +8,7 @@
"test": "test"
},
"scripts": {
"build:watch": "tsc -w",
"prebuild": "run-s clean copy_artifacts",
"copy_artifacts": "copyfiles './artifacts/**/*' ./lib",
"build": "tsc",
@ -52,7 +53,7 @@
"tslint": "5.8.0",
"types-bn": "^0.0.1",
"types-ethereumjs-util": "0xproject/types-ethereumjs-util",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8",
"yargs": "^10.0.3"
},

View File

@ -60,6 +60,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Lint
```bash

View File

@ -5,6 +5,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"build": "yarn clean && copyfiles 'test/fixtures/contracts/**/*' src/solc/solc_bin/* ./lib && tsc",
"test": "npm run build; mocha lib/test/*_test.js",
"compile": "npm run build; node lib/src/cli.js compile",
@ -29,7 +30,7 @@
"devDependencies": {
"copyfiles": "^1.2.0",
"types-bn": "^0.0.1",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8"
},
"dependencies": {

View File

@ -5,6 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"build": "tsc",
"clean": "shx rm -rf lib",
"lint": "tslint --project . 'src/**/*.ts'"
@ -27,7 +28,7 @@
"tslint": "5.8.0",
"types-bn": "^0.0.1",
"types-ethereumjs-util": "0xproject/types-ethereumjs-util",
"typescript": "~2.6.1"
"typescript": "2.7.1"
},
"dependencies": {
"@0xproject/utils": "^0.2.4",

View File

@ -49,6 +49,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Lint
```bash

View File

@ -5,6 +5,7 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
"test": "run-s clean build run_mocha",
"test:circleci": "yarn test",
@ -40,6 +41,6 @@
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1"
"typescript": "2.7.1"
}
}

View File

@ -40,6 +40,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Clean
```bash

View File

@ -4,6 +4,7 @@
"private": true,
"description": "Helper scripts for the monorepo",
"scripts": {
"build:watch": "tsc -w",
"deps_versions": "node ./lib/deps_versions.js",
"lint": "tslint --project . 'src/**/*.ts'",
"clean": "shx rm -rf lib",
@ -24,7 +25,7 @@
"@types/node": "^8.0.53",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1"
"typescript": "2.7.1"
},
"dependencies": {
"chalk": "^2.3.0",

View File

@ -64,6 +64,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Clean
```bash

View File

@ -5,6 +5,7 @@
"types": "lib/src/index.d.ts",
"license": "Apache-2.0",
"scripts": {
"build:watch": "tsc -w",
"clean": "shx rm -rf lib",
"build": "tsc",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
@ -48,7 +49,7 @@
"tslint": "5.8.0",
"types-bn": "^0.0.1",
"types-ethereumjs-util": "0xproject/types-ethereumjs-util",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8",
"webpack": "^3.1.0"
}

View File

@ -5,6 +5,7 @@
"description": "A faucet micro-service that dispenses test ERC20 tokens or Ether",
"main": "server.js",
"scripts": {
"build:watch": "tsc -w",
"build": "node ../../node_modules/gulp/bin/gulp.js build",
"dev": "node ../../node_modules/gulp/bin/gulp.js run",
"start": "node ./bin/server.js",
@ -35,7 +36,7 @@
"shx": "^0.2.2",
"source-map-loader": "^0.1.6",
"tslint": "5.8.0",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8",
"webpack": "^3.1.0",
"webpack-node-externals": "^1.6.0"

View File

@ -44,6 +44,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Lint
```bash

View File

@ -4,6 +4,7 @@
"description": "Lint rules related to 0xProject for TSLint",
"main": "tslint.json",
"scripts": {
"build:watch": "tsc -w",
"build": "tsc",
"clean": "shx rm -rf lib",
"lint": "tslint --project . 'rules/**/*.ts'"
@ -38,7 +39,7 @@
"shx": "^0.2.2",
"tslint": "5.8.0",
"tslint-eslint-rules": "^4.1.1",
"typescript": "~2.6.1"
"typescript": "2.7.1"
},
"dependencies": {
"lodash": "^4.17.4",

View File

@ -40,6 +40,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Lint
```bash

View File

@ -5,6 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"build": "tsc",
"clean": "shx rm -rf lib",
"lint": "tslint --project . 'src/**/*.ts'"
@ -22,7 +23,7 @@
"@0xproject/tslint-config": "^0.4.6",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8"
},
"dependencies": {

View File

@ -40,6 +40,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Lint
```bash

View File

@ -5,6 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"build": "tsc",
"clean": "shx rm -rf lib",
"lint": "tslint --project . 'src/**/*.ts'"
@ -25,7 +26,7 @@
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8"
},
"dependencies": {

View File

@ -24,7 +24,7 @@
"@types/bignumber.js": "^4.0.2",
"tslint": "5.8.0",
"tslint-config-0xproject": "^0.0.2",
"typescript": "~2.6.1"
"typescript": "2.7.1"
},
"dependencies": {
"bignumber.js": "~4.1.0"

View File

@ -44,6 +44,12 @@ yarn install
yarn build
```
or
```bash
yarn build:watch
```
### Lint
```bash

View File

@ -5,6 +5,7 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"build": "tsc",
"clean": "shx rm -rf lib",
"lint": "tslint --project . 'src/**/*.ts'"
@ -25,7 +26,7 @@
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8"
},
"dependencies": {

View File

@ -96,7 +96,7 @@
"source-map-loader": "^0.1.6",
"style-loader": "0.13.x",
"tslint": "5.8.0",
"typescript": "~2.6.1",
"typescript": "2.7.1",
"web3-typescript-typings": "^0.9.8",
"webpack": "^3.1.0",
"webpack-dev-middleware": "^1.10.0",

View File

@ -9109,9 +9109,9 @@ typescript@2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc"
typescript@~2.6.1:
version "2.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
typescript@2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.1.tgz#bb3682c2c791ac90e7c6210b26478a8da085c359"
ua-parser-js@^0.7.9:
version "0.7.17"