aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/CHANGELOG.json12
-rw-r--r--packages/utils/CHANGELOG.md22
-rw-r--r--packages/utils/README.md18
-rw-r--r--packages/utils/package.json17
-rw-r--r--packages/utils/src/abi_decoder.ts2
-rw-r--r--packages/utils/src/interval_utils.ts8
6 files changed, 46 insertions, 33 deletions
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index e7f3c052c..d3c7da7b9 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,12 +1,22 @@
[
{
+ "timestamp": 1525477860,
+ "version": "0.6.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "0.6.0",
"changes": [
{
"note": "Update ethers-contracts to ethers.js",
"pr": 540
}
- ]
+ ],
+ "timestamp": 1525428773
},
{
"version": "0.5.2",
diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
index 1f4a76d24..92e466b17 100644
--- a/packages/utils/CHANGELOG.md
+++ b/packages/utils/CHANGELOG.md
@@ -5,11 +5,19 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v0.6.1 - _May 5, 2018_
+
+ * Dependencies updated
+
+## v0.6.0 - _May 4, 2018_
+
+ * Update ethers-contracts to ethers.js (#540)
+
## v0.5.2 - _April 18, 2018_
* Export NULL_BYTES constant (#500)
-## v0.5.1 - _April 12, 2018_
+## v0.5.1 - _April 11, 2018_
* Dependencies updated
@@ -21,28 +29,28 @@ CHANGELOG
* Dependencies updated
-## v0.4.3 - _March 18, 2018_
+## v0.4.3 - _March 17, 2018_
* Add `@types/node` to dependencies since `intervalUtils` has the `NodeJS` type as part of its public interface.
-## v0.4.2 - _March 18, 2018_
+## v0.4.2 - _March 17, 2018_
* Consolidate all `console.log` calls into `logUtils` in the `@0xproject/utils` package (#452)
-## v0.4.0 - _March 4, 2018_
+## v0.4.0 - _March 3, 2018_
* Use `ethers-contracts` as a backend to decode event args (#413)
* Move web3 types from devDep to dep since required when using this package (#429)
-## v0.3.2 - _February 9, 2018_
+## v0.3.2 - _February 8, 2018_
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
-## v0.3.0 - _February 5, 2018_
+## v0.3.0 - _February 4, 2018_
* Fix a bug related to event signature collisions (argument indexes aren't included in event signatures) in the abi_decoder. The decoder used to throw on unknown events with identical signatures as a known event (except indexes). (#366)
-## v0.2.0 - _January 17, 2018_
+## v0.2.0 - _January 16, 2018_
* Add `onError` parameter to `intervalUtils.setAsyncExcludingInterval` (#312)
* Add `intervalUtils.setInterval` (#312)
diff --git a/packages/utils/README.md b/packages/utils/README.md
index 914404937..c637c9af5 100644
--- a/packages/utils/README.md
+++ b/packages/utils/README.md
@@ -44,28 +44,16 @@ yarn install
### Build
-If this is your **first** time building this package, you must first build **all** packages within the monorepo. This is because packages that depend on other packages located inside this monorepo are symlinked when run from **within** the monorepo. This allows you to make changes across multiple packages without first publishing dependent packages to NPM. To build all packages, run the following from the monorepo root directory:
+To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-yarn lerna:rebuild
+PKG=@0xproject/utils yarn build
```
Or continuously rebuild on change:
```bash
-yarn dev
-```
-
-You can also build this specific package by running the following from within its directory:
-
-```bash
-yarn build
-```
-
-or continuously rebuild on change:
-
-```bash
-yarn build:watch
+PKG=@0xproject/utils yarn watch
```
### Clean
diff --git a/packages/utils/package.json b/packages/utils/package.json
index f309c2126..d39077148 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,14 +1,17 @@
{
"name": "@0xproject/utils",
- "version": "0.5.2",
+ "version": "0.6.1",
+ "engines": {
+ "node" : ">=6.12"
+ },
"description": "0x TS utils",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
- "build:watch": "tsc -w",
+ "watch": "tsc -w",
"build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts",
"clean": "shx rm -rf lib scripts",
- "lint": "tslint --project . 'src/**/*.ts'",
+ "lint": "tslint --project .",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
},
"license": "Apache-2.0",
@@ -21,8 +24,8 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md",
"devDependencies": {
- "@0xproject/monorepo-scripts": "^0.1.18",
- "@0xproject/tslint-config": "^0.4.16",
+ "@0xproject/monorepo-scripts": "^0.1.19",
+ "@0xproject/tslint-config": "^0.4.17",
"@types/lodash": "4.14.104",
"copyfiles": "^1.2.0",
"npm-run-all": "^4.1.2",
@@ -31,8 +34,8 @@
"typescript": "2.7.1"
},
"dependencies": {
- "@0xproject/types": "^0.6.1",
- "@0xproject/typescript-typings": "^0.2.0",
+ "@0xproject/types": "^0.6.3",
+ "@0xproject/typescript-typings": "^0.3.1",
"@types/node": "^8.0.53",
"bignumber.js": "~4.1.0",
"ethers": "^3.0.15",
diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts
index 150f74a15..d329f917a 100644
--- a/packages/utils/src/abi_decoder.ts
+++ b/packages/utils/src/abi_decoder.ts
@@ -17,7 +17,7 @@ import { BigNumber } from './configured_bignumber';
export class AbiDecoder {
private _savedABIs: AbiDefinition[] = [];
private _methodIds: { [signatureHash: string]: EventAbi } = {};
- private static _padZeros(address: string) {
+ private static _padZeros(address: string): string {
let formatted = address;
if (_.startsWith(formatted, '0x')) {
formatted = formatted.slice(2);
diff --git a/packages/utils/src/interval_utils.ts b/packages/utils/src/interval_utils.ts
index ebecc7015..6984bf42d 100644
--- a/packages/utils/src/interval_utils.ts
+++ b/packages/utils/src/interval_utils.ts
@@ -1,7 +1,11 @@
import * as _ from 'lodash';
export const intervalUtils = {
- setAsyncExcludingInterval(fn: () => Promise<void>, intervalMs: number, onError: (err: Error) => void) {
+ setAsyncExcludingInterval(
+ fn: () => Promise<void>,
+ intervalMs: number,
+ onError: (err: Error) => void,
+ ): NodeJS.Timer {
let locked = false;
const intervalId = setInterval(async () => {
if (locked) {
@@ -21,7 +25,7 @@ export const intervalUtils = {
clearAsyncExcludingInterval(intervalId: NodeJS.Timer): void {
clearInterval(intervalId);
},
- setInterval(fn: () => void, intervalMs: number, onError: (err: Error) => void) {
+ setInterval(fn: () => void, intervalMs: number, onError: (err: Error) => void): NodeJS.Timer {
const intervalId = setInterval(() => {
try {
fn();