Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #358 from 0xProject/feature/build_watch
Browse files Browse the repository at this point in the history
Add build:watch command to all TS packages
  • Loading branch information
LogvinovLeon committed Feb 5, 2018
2 parents 44cd185 + 85b4a82 commit c7ad6eb
Show file tree
Hide file tree
Showing 30 changed files with 100 additions and 24 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -81,6 +81,12 @@ Build all packages
yarn lerna:run build
```

Continuously rebuild on exchange

```bash
yarn dev
```

### Lint

Lint all packages
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion packages/0x.js/package.json
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions packages/0x.js/src/contract_wrappers/contract_wrapper.ts
Expand Up @@ -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>;
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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> {
Expand Down
3 changes: 2 additions & 1 deletion packages/abi-gen/package.json
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
}
}
3 changes: 2 additions & 1 deletion packages/assert/package.json
Expand Up @@ -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'",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion packages/connect/package.json
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
6 changes: 6 additions & 0 deletions packages/contracts/README.md
Expand Up @@ -38,6 +38,12 @@ yarn install
yarn build
```

or

```bash
yarn build:watch
```

### Clean

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/contracts/package.json
Expand Up @@ -8,6 +8,7 @@
"test": "test"
},
"scripts": {
"build:watch": "tsc -w",
"prebuild": "run-s clean copy_artifacts",
"copy_artifacts": "copyfiles './artifacts/**/*' ./lib",
"build": "tsc",
Expand Down Expand Up @@ -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"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/deployer/README.md
Expand Up @@ -60,6 +60,12 @@ yarn install
yarn build
```

or

```bash
yarn build:watch
```

### Lint

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/deployer/package.json
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion packages/dev-utils/package.json
Expand Up @@ -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'"
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions packages/json-schemas/README.md
Expand Up @@ -49,6 +49,12 @@ yarn install
yarn build
```

or

```bash
yarn build:watch
```

### Lint

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/json-schemas/package.json
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
6 changes: 6 additions & 0 deletions packages/monorepo-scripts/README.md
Expand Up @@ -40,6 +40,12 @@ yarn install
yarn build
```

or

```bash
yarn build:watch
```

### Clean

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/monorepo-scripts/package.json
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions packages/subproviders/README.md
Expand Up @@ -64,6 +64,12 @@ yarn install
yarn build
```

or

```bash
yarn build:watch
```

### Clean

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/subproviders/package.json
Expand Up @@ -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'",
Expand Down Expand Up @@ -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"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/testnet-faucets/package.json
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions packages/tslint-config/README.md
Expand Up @@ -44,6 +44,12 @@ yarn install
yarn build
```

or

```bash
yarn build:watch
```

### Lint

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/tslint-config/package.json
Expand Up @@ -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'"
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions packages/types/README.md
Expand Up @@ -40,6 +40,12 @@ yarn install
yarn build
```

or

```bash
yarn build:watch
```

### Lint

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/types/package.json
Expand Up @@ -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'"
Expand All @@ -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": {
Expand Down
6 changes: 6 additions & 0 deletions packages/utils/README.md
Expand Up @@ -40,6 +40,12 @@ yarn install
yarn build
```

or

```bash
yarn build:watch
```

### Lint

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/utils/package.json
Expand Up @@ -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'"
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-typescript-typings/package.json
Expand Up @@ -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"
Expand Down

0 comments on commit c7ad6eb

Please sign in to comment.