From c4538cada7017a838c268ba1f01824a4e1e25928 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 4 Jun 2018 13:36:34 -0700 Subject: Don't automatically rebuild when running yarn test --- packages/connect/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index d1e392606..fa91bf632 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -21,7 +21,8 @@ "copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures", "lint": "tslint --project .", "run_mocha": "mocha lib/test/**/*_test.js --exit", - "test": "run-s clean build copy_test_fixtures run_mocha", + "test": "run-s copy_test_fixtures run_mocha", + "rebuild-and-test": "run-s clean build test", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", -- cgit v1.2.3 From 9778695b4ad1fd999eb79b01c768a2f2b9938917 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 4 Jun 2018 19:48:21 -0700 Subject: Try enabling no-unused-variable... --- packages/connect/src/types.ts | 2 +- packages/connect/src/utils/relayer_response_json_parsers.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts index 074ab950f..f5e52f50d 100644 --- a/packages/connect/src/types.ts +++ b/packages/connect/src/types.ts @@ -1,4 +1,4 @@ -import { Order, SignedOrder } from '@0xproject/types'; +import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; export interface Client { diff --git a/packages/connect/src/utils/relayer_response_json_parsers.ts b/packages/connect/src/utils/relayer_response_json_parsers.ts index cf1c07bd9..ccae8b115 100644 --- a/packages/connect/src/utils/relayer_response_json_parsers.ts +++ b/packages/connect/src/utils/relayer_response_json_parsers.ts @@ -1,7 +1,6 @@ import { assert } from '@0xproject/assert'; import { schemas } from '@0xproject/json-schemas'; import { SignedOrder } from '@0xproject/types'; -import * as _ from 'lodash'; import { FeesResponse, OrderbookResponse, TokenPairsItem } from '../types'; -- cgit v1.2.3 From 86a6a5b826158fbf3b16081a2ecdbb020140adda Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 5 Jun 2018 12:20:23 +0200 Subject: Replace `-` with `_` in yarn script name so that we are consistent across yarn script names --- packages/connect/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index fa91bf632..1545fe25f 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -22,7 +22,7 @@ "lint": "tslint --project .", "run_mocha": "mocha lib/test/**/*_test.js --exit", "test": "run-s copy_test_fixtures run_mocha", - "rebuild-and-test": "run-s clean build test", + "rebuild_and_test": "run-s clean build test", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", -- cgit v1.2.3 From 25f62daf146895a1e0e0c966166f08f28467ae2e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 5 Jun 2018 15:38:40 +0200 Subject: - Rename watch to watch_without_deps in sub-packages, so dev's don't confuse running watch from root dir, with sub-package dir - stop using special prebuild script name and run pre_build steps for `watch` and `build` commands - Remove `clean` step from `build`/`watch` --- packages/connect/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index fa91bf632..64381f063 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -15,7 +15,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "watch": "tsc -w", + "watch_without_deps": "tsc -w", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib test_temp scripts", "copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures", -- cgit v1.2.3 From d299458084c46e635d217c777ebc51c47c26a247 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 6 Jun 2018 16:51:22 -0700 Subject: Use source-map-support package to include correct line numbers in mocha --- packages/connect/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index 5079467e4..6b5a5a7b0 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -20,7 +20,7 @@ "clean": "shx rm -rf lib test_temp scripts", "copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures", "lint": "tslint --project .", - "run_mocha": "mocha lib/test/**/*_test.js --exit", + "run_mocha": "mocha --require source-map-support/register lib/test/**/*_test.js --exit", "test": "run-s copy_test_fixtures run_mocha", "rebuild_and_test": "run-s clean build test", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", -- cgit v1.2.3 From e1879ef4d91fc58203d9748eca38695b79c43674 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 11 Jun 2018 23:42:30 +0200 Subject: Fix no-unused-variable tslint rule to include parameters and fix issues --- packages/connect/src/http_client.ts | 2 +- packages/connect/src/ws_orderbook_channel.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index 5806f1d43..f6503835a 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -48,7 +48,7 @@ export class HttpClient implements Client { return ''; } // format params into a form the api expects - const formattedParams = _.mapKeys(params, (value: any, key: string) => { + const formattedParams = _.mapKeys(params, (_value: any, key: string) => { return _.get(OPTS_TO_QUERY_FIELD_MAP, key, key); }); // stringify the formatted object diff --git a/packages/connect/src/ws_orderbook_channel.ts b/packages/connect/src/ws_orderbook_channel.ts index 4a9d4058f..bdcc8a75d 100644 --- a/packages/connect/src/ws_orderbook_channel.ts +++ b/packages/connect/src/ws_orderbook_channel.ts @@ -78,7 +78,7 @@ export class WebSocketOrderbookChannel implements OrderbookChannel { connection.on(WebsocketConnectionEventType.Error, wsError => { handler.onError(this, subscriptionOpts, wsError); }); - connection.on(WebsocketConnectionEventType.Close, (code: number, desc: string) => { + connection.on(WebsocketConnectionEventType.Close, (_code: number, _desc: string) => { handler.onClose(this, subscriptionOpts); }); connection.on(WebsocketConnectionEventType.Message, message => { -- cgit v1.2.3