From 478f6ed011185b66ac87323c6d9ad1f598060760 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 19:23:50 +0200 Subject: Move from using lerna multi-package commands to wsrun, update README's accordingly --- .circleci/config.yml | 12 +++--- README.md | 67 +++++++++++++++++++++++++------- package.json | 26 +++++++------ packages/0x.js/README.md | 18 ++------- packages/0x.js/package.json | 2 +- packages/abi-gen/README.md | 18 ++------- packages/abi-gen/package.json | 2 +- packages/assert/README.md | 18 ++------- packages/assert/package.json | 2 +- packages/base-contract/README.md | 8 ++-- packages/base-contract/package.json | 2 +- packages/connect/README.md | 18 ++------- packages/connect/package.json | 2 +- packages/contract-wrappers/README.md | 10 ++--- packages/contract-wrappers/package.json | 2 +- packages/contracts/README.md | 18 ++------- packages/contracts/package.json | 2 +- packages/dev-utils/README.md | 18 ++------- packages/dev-utils/package.json | 2 +- packages/fill-scenarios/README.md | 18 ++------- packages/fill-scenarios/package.json | 2 +- packages/json-schemas/README.md | 18 ++------- packages/json-schemas/package.json | 2 +- packages/metacoin/package.json | 2 +- packages/migrations/README.md | 18 ++------- packages/migrations/package.json | 2 +- packages/monorepo-scripts/README.md | 20 ++-------- packages/monorepo-scripts/package.json | 3 +- packages/monorepo-scripts/src/publish.ts | 2 +- packages/order-utils/README.md | 18 ++------- packages/order-utils/package.json | 2 +- packages/order-watcher/README.md | 18 ++------- packages/order-watcher/package.json | 2 +- packages/react-docs-example/README.md | 14 +++++-- packages/react-docs-example/package.json | 2 +- packages/react-docs/README.md | 18 ++------- packages/react-docs/package.json | 2 +- packages/react-shared/README.md | 18 ++------- packages/react-shared/package.json | 2 +- packages/sol-compiler/README.md | 18 ++------- packages/sol-compiler/package.json | 2 +- packages/sol-cov/README.md | 18 ++------- packages/sol-cov/package.json | 2 +- packages/sol-resolver/README.md | 67 ++++++++++++++++++++++++++++++++ packages/sol-resolver/package.json | 2 +- packages/sra-report/README.md | 18 ++------- packages/sra-report/package.json | 2 +- packages/subproviders/README.md | 18 ++------- packages/subproviders/package.json | 2 +- packages/testnet-faucets/README.md | 20 ++-------- packages/testnet-faucets/package.json | 2 +- packages/tslint-config/README.md | 18 ++------- packages/tslint-config/package.json | 2 +- packages/types/README.md | 18 ++------- packages/types/package.json | 2 +- packages/typescript-typings/README.md | 18 ++------- packages/typescript-typings/package.json | 1 + packages/utils/README.md | 18 ++------- packages/utils/package.json | 2 +- packages/web3-wrapper/README.md | 18 ++------- packages/website/README.md | 8 ++-- packages/website/package.json | 2 +- yarn.lock | 27 ++++++++----- 63 files changed, 286 insertions(+), 449 deletions(-) create mode 100644 packages/sol-resolver/README.md diff --git a/.circleci/config.yml b/.circleci/config.yml index dbd8b2926..6bf897c1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ jobs: - run: wget https://s3.amazonaws.com/testrpc-shapshots/${CONTRACTS_COMMIT_HASH}.zip - run: unzip ${CONTRACTS_COMMIT_HASH}.zip -d testrpc_snapshot - run: node ./node_modules/lerna/bin/lerna.js bootstrap - - run: yarn lerna:run build + - run: yarn build - save_cache: key: repo-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -48,7 +48,7 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run --scope 0x.js test:circleci + - run: yarn wsrun test:circleci 0x.js - save_cache: key: coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -65,7 +65,7 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run --scope contracts test:circleci + - run: yarn wsrun test:circleci contracts - save_cache: key: coverage-contracts-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -82,7 +82,7 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run --scope @0xproject/sol-compiler test:circleci + - run: yarn wsrun test:circleci @0xproject/sol-compiler - save_cache: key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -99,7 +99,7 @@ jobs: name: testrpc command: npm run testrpc -- --db testrpc_snapshot background: true - - run: yarn lerna:run --ignore contracts --ignore 0x.js --ignore @0xproject/sol-compiler test:circleci + - run: yarn wsrun test:circleci --exclude contracts --exclude 0x.js --exclude @0xproject/sol-compiler --stages --exclude-missing - save_cache: key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }} paths: @@ -136,7 +136,7 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn lerna:run lint + - run: yarn wsrun lint --parallel --exclude-missing prettier: working_directory: ~/repo docker: diff --git a/README.md b/README.md index de77e980e..cd7fd44b1 100644 --- a/README.md +++ b/README.md @@ -78,45 +78,86 @@ We strongly recommend that the community help us make improvements and determine ### Install dependencies If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: - ```bash yarn config set workspaces-experimental true ``` Then install dependencies - ```bash yarn install ``` ### Build -Build all packages. You need to do this before working on any given package. Although these packages -as independent, when run from within the monorepo, they are internally symlinked, to make development -easier. You can change several packages and run the changes without publishing them first to NPM. When -running `rebuild`, Lerna will figure out the dependency order of all the packages, and build them in -this order. +To build all packages: +```bash +yarn build +``` + +To build a specific package: +```bash +PKG=@0xproject/web3-wrapper yarn build +``` + +### Watch +To re-build all packages on change: ```bash -yarn lerna:rebuild +yarn watch ``` -Or continuously rebuild on change: +To watch a specific package and all it's dependent packages: +```bash +PKG=[NPM_PACKAGE_NAME] yarn watch + +e.g +PKG=@0xproject/web3-wrapper yarn watch +``` +### Clean + +Clean all packages: ```bash -yarn dev +yarn clean +``` + +Clean a specific package +```bash +PKG=0x.js yarn clean +``` + +### Rebuild + +To re-build (clean & build) all packages: +```bash +yarn rebuild +``` + +To re-build (clean & build) a specific package & it's deps: +```bash +PKG=0x.js yarn rebuild ``` ### Lint -Lint all packages +Lint all packages: +```bash +yarn lint +``` +Lint a specific package: ```bash -yarn lerna:run lint +PKG=0x.js yarn lint ``` ### Run Tests +Run all tests: +```bash +yarn test +``` + +Run a specific package's test: ```bash -yarn lerna:test +PKG=@0xproject/web3-wrapper yarn test ``` diff --git a/package.json b/package.json index 3f2486656..231371623 100644 --- a/package.json +++ b/package.json @@ -5,23 +5,24 @@ "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", "report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls", "test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js", - "lerna:install": "yarn install", - "lerna:run": "lerna run", - "lerna:test": "lerna run test", - "lerna:clean": "lerna run clean", - "lerna:build": "lerna run build", - "lerna:rebuild": "run-s lerna:clean lerna:build", - "lerna:publish": "run-s lerna:install lerna:rebuild script:publish", - "lerna:publish:dry": "run-s lerna:install lerna:rebuild script:publish:dry", - "lerna:stage_docs": "lerna run docs:stage", + "publish": "run-s install rebuild script:publish", + "publish:dry": "run-s install rebuild script:publish:dry", "script:publish": "node ./packages/monorepo-scripts/lib/publish.js", - "script:publish:dry": "IS_DRY_RUN=true yarn script:publish" + "script:publish:dry": "IS_DRY_RUN=true yarn script:publish", + "install": "yarn install", + "wsrun": "wsrun", + "watch": "wsrun watch $PKG -r --stages --done-criteria='complete|successfully'", + "build": "wsrun build $PKG -r --stages", + "clean": "wsrun clean $PKG -r --parallel", + "rebuild": "run-s clean build", + "test": "wsrun test $PKG --serial --exclude-missing", + "stage_docs": "wsrun docs:stage $PKG --parallel --exclude-missing", + "lint": "wsrun lint $PKG --parallel --exclude-missing" }, "config": { "mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic" @@ -33,6 +34,7 @@ "lcov-result-merger": "^2.0.0", "lerna": "^2.5.1", "npm-run-all": "^4.1.2", - "prettier": "^1.11.1" + "prettier": "^1.11.1", + "wsrun": "^2.2.0" } } diff --git a/packages/0x.js/README.md b/packages/0x.js/README.md index 8d84f6c82..fd6217151 100644 --- a/packages/0x.js/README.md +++ b/packages/0x.js/README.md @@ -64,28 +64,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=0x.js 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=0x.js yarn watch ``` ### Clean diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 36ea0751f..8dcd8a6e2 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -12,7 +12,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", "build": "run-p build:umd:prod build:commonjs; exit 0;", "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", diff --git a/packages/abi-gen/README.md b/packages/abi-gen/README.md index 301bd709f..4240ba7ba 100644 --- a/packages/abi-gen/README.md +++ b/packages/abi-gen/README.md @@ -80,28 +80,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/abi-gen 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/abi-gen yarn watch ``` ### Clean diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 82184a596..a151ff2e2 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "lint": "tslint --project .", "clean": "shx rm -rf lib scripts", "build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", diff --git a/packages/assert/README.md b/packages/assert/README.md index 598fee613..1f2139d47 100644 --- a/packages/assert/README.md +++ b/packages/assert/README.md @@ -46,28 +46,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/assert 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/assert yarn watch ``` ### Clean diff --git a/packages/assert/package.json b/packages/assert/package.json index f86bbb33f..dc72313cb 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib test_temp scripts", "lint": "tslint --project .", diff --git a/packages/base-contract/README.md b/packages/base-contract/README.md index a689d0130..4f2426c2e 100644 --- a/packages/base-contract/README.md +++ b/packages/base-contract/README.md @@ -44,14 +44,16 @@ yarn install ### Build +To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory: + ```bash -yarn build +PKG=@0xproject/base-contract yarn build ``` -or +Or continuously rebuild on change: ```bash -yarn build:watch +PKG=@0xproject/base-contract yarn watch ``` ### Lint diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json index 90253616b..565d06416 100644 --- a/packages/base-contract/package.json +++ b/packages/base-contract/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/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", "test": "run-s clean build run_mocha", diff --git a/packages/connect/README.md b/packages/connect/README.md index a57fefa59..9d8cb9215 100644 --- a/packages/connect/README.md +++ b/packages/connect/README.md @@ -43,28 +43,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/connect 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/connect yarn watch ``` ### Clean diff --git a/packages/connect/package.json b/packages/connect/package.json index 2930de98e..379d8f698 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -12,7 +12,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "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", diff --git a/packages/contract-wrappers/README.md b/packages/contract-wrappers/README.md index 0fca4c762..4d7820056 100644 --- a/packages/contract-wrappers/README.md +++ b/packages/contract-wrappers/README.md @@ -48,19 +48,19 @@ 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/contract-wrappers yarn build ``` Or continuously rebuild on change: ```bash -yarn dev +PKG=@0xproject/contract-wrappers yarn watch ``` -You can also build this specific package by running the following from within its directory: + ```bash yarn build @@ -69,7 +69,7 @@ yarn build or continuously rebuild on change: ```bash -yarn build:watch +yarn watch ``` ### Clean diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 2b53f5c8d..1ebdf7252 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -11,7 +11,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", "lint": "tslint --project .", diff --git a/packages/contracts/README.md b/packages/contracts/README.md index 16e253549..23551b69d 100644 --- a/packages/contracts/README.md +++ b/packages/contracts/README.md @@ -34,28 +34,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=contracts 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=contracts yarn watch ``` ### Clean diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 557effca2..14f6e53f0 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -8,7 +8,7 @@ "test": "test" }, "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "prebuild": "run-s clean copy_artifacts generate_contract_wrappers", "copy_artifacts": "copyfiles -u 4 '../migrations/artifacts/1.0.0/**/*' ./lib/src/artifacts;", "build": "tsc", diff --git a/packages/dev-utils/README.md b/packages/dev-utils/README.md index 2b183f1c7..1c3bd3a3f 100644 --- a/packages/dev-utils/README.md +++ b/packages/dev-utils/README.md @@ -49,28 +49,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/dev-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/dev-utils yarn watch ``` ### Clean diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 67b448024..b899409ab 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "test": "run-s clean build run_mocha", "test:circleci": "yarn test:coverage", diff --git a/packages/fill-scenarios/README.md b/packages/fill-scenarios/README.md index e4cec0695..67df0941f 100644 --- a/packages/fill-scenarios/README.md +++ b/packages/fill-scenarios/README.md @@ -38,28 +38,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/fill-scenarios 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/fill-scenarios yarn watch ``` ### Clean diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json index 6a728b742..0a3742e8c 100644 --- a/packages/fill-scenarios/package.json +++ b/packages/fill-scenarios/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", "build": "tsc && copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/compact_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", diff --git a/packages/json-schemas/README.md b/packages/json-schemas/README.md index ffa8e947a..ab57833be 100644 --- a/packages/json-schemas/README.md +++ b/packages/json-schemas/README.md @@ -52,28 +52,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/json-schemas 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/json-schemas yarn watch ``` ### Clean diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index 9da9da2b7..0926474d2 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "lint": "tslint --project .", "test": "run-s clean build run_mocha", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index be1a33d65..204d940ad 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -4,7 +4,7 @@ "private": true, "description": "Example solidity project using 0x dev tools", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "lint": "tslint --project .", "clean": "shx rm -rf lib artifacts src/contract_wrappers", "prebuild": "run-s clean compile generate_contract_wrappers copy_artifacts", diff --git a/packages/migrations/README.md b/packages/migrations/README.md index 15129ae85..83a49fefb 100644 --- a/packages/migrations/README.md +++ b/packages/migrations/README.md @@ -24,28 +24,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/migrations 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/migrations yarn watch ``` ### Clean diff --git a/packages/migrations/package.json b/packages/migrations/package.json index 95922f7b6..5eaa9530c 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "prebuild": "run-s clean compile copy_artifacts generate_contract_wrappers", "copy_artifacts": "copyfiles -u 4 'artifacts/1.0.0/**/*' ./lib/src/artifacts", "build": "tsc", diff --git a/packages/monorepo-scripts/README.md b/packages/monorepo-scripts/README.md index cec77a10d..22b449870 100644 --- a/packages/monorepo-scripts/README.md +++ b/packages/monorepo-scripts/README.md @@ -4,7 +4,7 @@ This repository contains a few helpful scripts for working with this mono repo. #### Scripts -**`yarn deps_versions`**: Since we use Lerna + Yarn workspaces, shared dependencies between packages in the monorepo get hoisted to a top-level `node_modules` directory. If two packages use different versions of the same dependency however, both get installed. To avoid having many versions of a dependency installed, we try to keep dependency versions the same across packages in the monorepo. This script will list any dependencies for which we have multiple versions installed. We can then go through them and try to consolidate to a single version where possible. +**`yarn deps_versions`**: Since we are a Yarn workspaces monorepo, shared dependencies between packages in the monorepo get hoisted to a top-level `node_modules` directory. If two packages use different versions of the same dependency however, both get installed. To avoid having many versions of a dependency installed, we try to keep dependency versions the same across packages in the monorepo. This script will list any dependencies for which we have multiple versions installed. We can then go through them and try to consolidate to a single version where possible. **`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. @@ -46,28 +46,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/monorepo-scripts 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/monorepo-scripts yarn watch ``` ### Clean diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json index ef5840546..ca82a5531 100644 --- a/packages/monorepo-scripts/package.json +++ b/packages/monorepo-scripts/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "lint": "tslint --project .", "clean": "shx rm -rf lib", "build": "tsc", @@ -26,7 +26,6 @@ "url": "https://github.com/0xProject/0x-monorepo/issues" }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/monorepo-scripts/README.md", - "comment": "// We purposefully use an older version of tslint-config here to avoid creating an import cycle", "devDependencies": { "@types/glob": "^5.0.33", "@types/node": "^8.0.53", diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index a5be40014..31c85e3cc 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -75,7 +75,7 @@ const packageNameToWebsitePath: { [name: string]: string } = { async function confirmDocPagesRenderAsync(packages: LernaPackage[]) { // push docs to staging utils.log("Upload all docJson's to S3 staging..."); - await execAsync(`yarn lerna:stage_docs`, { cwd: constants.monorepoRootPath }); + await execAsync(`yarn stage_docs`, { cwd: constants.monorepoRootPath }); // deploy website to staging utils.log('Deploy website to staging...'); diff --git a/packages/order-utils/README.md b/packages/order-utils/README.md index 4b571509a..33df1d4b0 100644 --- a/packages/order-utils/README.md +++ b/packages/order-utils/README.md @@ -40,28 +40,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/order-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/order-utils yarn watch ``` ### Clean diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index cdb5b63b0..5ef0bb97d 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "test": "run-s clean build run_mocha", "test:circleci": "yarn test:coverage", diff --git a/packages/order-watcher/README.md b/packages/order-watcher/README.md index d461dca8d..de64a70e7 100644 --- a/packages/order-watcher/README.md +++ b/packages/order-watcher/README.md @@ -48,28 +48,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/order-watcher 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/order-watcher yarn watch ``` ### Clean diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 39162fd1e..0ac9f8592 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -12,7 +12,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", "lint": "tslint --project .", diff --git a/packages/react-docs-example/README.md b/packages/react-docs-example/README.md index ff821dba8..c7dfcd3aa 100644 --- a/packages/react-docs-example/README.md +++ b/packages/react-docs-example/README.md @@ -25,7 +25,7 @@ yarn install The **first** time you work with this package, you must 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: ```bash -yarn lerna:rebuild +PKG=0x.js yarn build ``` Note: If you move this package out of the monorepo, it will work without this step. Make sure you copy it out on the `master` branch since the `development` version might rely on not-yet published changes to other packages. @@ -35,7 +35,7 @@ Note: If you move this package out of the monorepo, it will work without this st The the `react-docs-example` root directory, run: ```bash -yarn dev +PKG=0x.js yarn watch ``` ### Deploy Example to S3 bucket @@ -50,8 +50,16 @@ yarn deploy_example ### Build +To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory: + +```bash +PKG=@0xproject/react-docs-example yarn build +``` + +Or continuously rebuild on change: + ```bash -yarn build +PKG=@0xproject/react-docs-example yarn watch ``` ### Clean diff --git a/packages/react-docs-example/package.json b/packages/react-docs-example/package.json index b6b6c6c7d..1c154d5c8 100644 --- a/packages/react-docs-example/package.json +++ b/packages/react-docs-example/package.json @@ -7,7 +7,7 @@ "lint": "tslint --project .", "build": "tsc", "build:example": "NODE_ENV=production webpack", - "build:watch": "tsc -w", + "watch": "tsc -w", "clean": "shx rm -rf lib; shx rm -f public/bundle*", "dev": "webpack-dev-server --open", "deploy_example": "npm run build:example; aws s3 sync ./public/. s3://react-docs-example --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers" diff --git a/packages/react-docs/README.md b/packages/react-docs/README.md index 5a46b84f0..c0efc4a0b 100644 --- a/packages/react-docs/README.md +++ b/packages/react-docs/README.md @@ -71,28 +71,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/react-docs 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/react-docs yarn watch ``` ### Clean diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index ca9ae610e..94d527d40 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -7,7 +7,7 @@ "scripts": { "lint": "tslint --project .", "build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", - "build:watch": "tsc -w", + "watch": "tsc -w", "clean": "shx rm -rf lib scripts", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, diff --git a/packages/react-shared/README.md b/packages/react-shared/README.md index 0b4188180..88e6f18ae 100644 --- a/packages/react-shared/README.md +++ b/packages/react-shared/README.md @@ -38,28 +38,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/react-shared 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/react-shared yarn watch ``` ### Clean diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json index b9a46376c..7d3eb186d 100644 --- a/packages/react-shared/package.json +++ b/packages/react-shared/package.json @@ -7,7 +7,7 @@ "scripts": { "lint": "tslint --project .", "build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts", - "build:watch": "tsc -w", + "watch": "tsc -w", "clean": "shx rm -rf lib scripts", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, diff --git a/packages/sol-compiler/README.md b/packages/sol-compiler/README.md index bb8175952..76d0e9b8b 100644 --- a/packages/sol-compiler/README.md +++ b/packages/sol-compiler/README.md @@ -60,28 +60,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/sol-compiler 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/sol-compiler yarn watch ``` ### Clean diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 19d390c32..fcb0b9cd0 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "build": "yarn clean && copyfiles 'test/fixtures/contracts/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "test": "run-s build run_mocha", "run_mocha": "mocha lib/test/*_test.js --bail --exit", diff --git a/packages/sol-cov/README.md b/packages/sol-cov/README.md index 3a0377521..0a63ac06e 100644 --- a/packages/sol-cov/README.md +++ b/packages/sol-cov/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/sol-cov 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/sol-cov yarn watch ``` ### Clean diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 6268df4c7..ec6207a1b 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "lint": "tslint --project .", "test": "run-s clean build compile_test run_mocha", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", diff --git a/packages/sol-resolver/README.md b/packages/sol-resolver/README.md new file mode 100644 index 000000000..8487947f0 --- /dev/null +++ b/packages/sol-resolver/README.md @@ -0,0 +1,67 @@ +## @0xproject/sol-resolver + +A Solidity import resolver used by [sol-compiler](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-compiler). + +## Installation + +```bash +yarn add @0xproject/sol-resolver +``` + +**Import** + +```javascript +import { Resolver } from '@0xproject/sol-resolver'; +``` + +or + +```javascript +var Resolver = require('@0xproject/sol-resolver').Resolver; +``` + +## Contributing + +We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository. + +Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. + +### Install dependencies + +If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: + +```bash +yarn config set workspaces-experimental true +``` + +Then install dependencies + +```bash +yarn install +``` + +### Build + +To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory: + +```bash +PKG=@0xproject/sol-resolver yarn build +``` + +Or continuously rebuild on change: + +```bash +PKG=@0xproject/sol-resolver yarn watch +``` + +### Clean + +```bash +yarn clean +``` + +### Lint + +```bash +yarn lint +``` diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json index 6e4ba97e4..1240d0afb 100644 --- a/packages/sol-resolver/package.json +++ b/packages/sol-resolver/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "build": "yarn clean && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib scripts", "lint": "tslint --project .", diff --git a/packages/sra-report/README.md b/packages/sra-report/README.md index 806ac3bf4..d8df36a29 100644 --- a/packages/sra-report/README.md +++ b/packages/sra-report/README.md @@ -107,28 +107,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/sra-report 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/sra-report yarn watch ``` ### Clean diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json index 1fc0d3ade..5f8701997 100644 --- a/packages/sra-report/package.json +++ b/packages/sra-report/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "clean": "shx rm -rf lib scripts", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "lint": "tslint --project .", diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index 8c8807895..90c9b7bbe 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -42,28 +42,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/subproviders 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/subproviders yarn watch ``` ### Clean diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index 92377f118..cf1ed32ec 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -5,7 +5,7 @@ "types": "lib/src/index.d.ts", "license": "Apache-2.0", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "clean": "shx rm -rf lib scripts", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "lint": "tslint --project .", diff --git a/packages/testnet-faucets/README.md b/packages/testnet-faucets/README.md index 93f97e1b7..a92b93fc0 100644 --- a/packages/testnet-faucets/README.md +++ b/packages/testnet-faucets/README.md @@ -28,28 +28,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/testnet-faucets 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/testnet-faucets yarn watch ``` ### Clean @@ -86,7 +74,7 @@ Infura API Key can be requested here: https://infura.io/signup Note: The above public/private keys exist when running `testrpc` with the following option `--mnemonic concert load couple harbor equip island argue ramp clarify fence smart topic`. ```bash -yarn dev +PKG=0x.js yarn watch ``` ### Endpoints diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index 48fe77bf4..f00ffad02 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -5,7 +5,7 @@ "description": "A faucet micro-service that dispenses test ERC20 tokens or Ether", "main": "server.js", "scripts": { - "build:watch": "tsc -w", + "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", diff --git a/packages/tslint-config/README.md b/packages/tslint-config/README.md index d90b3cf73..d630ec84d 100644 --- a/packages/tslint-config/README.md +++ b/packages/tslint-config/README.md @@ -40,28 +40,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/tslint-config 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/tslint-config yarn watch ``` ### Clean diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json index a5b34a35e..04e1ba2b6 100644 --- a/packages/tslint-config/package.json +++ b/packages/tslint-config/package.json @@ -4,7 +4,7 @@ "description": "Lint rules related to 0xProject for TSLint", "main": "tslint.json", "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 .", diff --git a/packages/types/README.md b/packages/types/README.md index 665701ea4..c091b8302 100644 --- a/packages/types/README.md +++ b/packages/types/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/types 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/types yarn watch ``` ### Clean diff --git a/packages/types/package.json b/packages/types/package.json index 973d5b8d0..be735914f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -5,7 +5,7 @@ "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 .", diff --git a/packages/typescript-typings/README.md b/packages/typescript-typings/README.md index 968b2e87c..439cb6484 100644 --- a/packages/typescript-typings/README.md +++ b/packages/typescript-typings/README.md @@ -40,28 +40,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/typescript-typings 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/typescript-typings yarn watch ``` ### Clean diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json index ad865854c..4643c1d81 100644 --- a/packages/typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -3,6 +3,7 @@ "version": "0.3.1", "description": "0x project typescript type definitions", "scripts": { + "watch": "tsc -w", "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", "clean": "shx rm -rf scripts", "manual:postpublish": "yarn build; node ./scripts/postpublish.js" 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 0924aefc3..c6906dd71 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -5,7 +5,7 @@ "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 .", diff --git a/packages/web3-wrapper/README.md b/packages/web3-wrapper/README.md index d752a9de0..bfa98deff 100644 --- a/packages/web3-wrapper/README.md +++ b/packages/web3-wrapper/README.md @@ -40,28 +40,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/web3-wrapper 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/web3-wrapper yarn watch ``` ### Clean diff --git a/packages/website/README.md b/packages/website/README.md index d93d18935..7115a3b5c 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -30,18 +30,16 @@ yarn install ### Initial setup -The **first** time you work with this package, you must 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/website yarn build ``` ### Run dev server -The the `website` root directory, run: - ```bash -yarn dev +PKG=@0xproject/website yarn watch ``` Visit [0xproject.localhost:3572](http://0xproject.localhost:3572) in your browser. diff --git a/packages/website/package.json b/packages/website/package.json index ad84a3eb9..286ceaca8 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -7,7 +7,7 @@ "build": "NODE_ENV=production webpack; exit 0;", "clean": "shx rm -f public/bundle*", "lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'", - "dev": "webpack-dev-server --content-base public --https", + "watch": "webpack-dev-server --content-base public --https", "deploy_staging": "npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers", "deploy_live": "npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers" }, diff --git a/yarn.lock b/yarn.lock index 02cda6ad6..1b314ccf0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,15 +6,6 @@ version "0.3.9" resolved "https://registry.yarnpkg.com/8fold-marked/-/8fold-marked-0.3.9.tgz#bb89c645612f8ccfaffac1ca6e3c11f168c9cf59" -"@0xproject/tslint-config@0.4.13": - version "0.4.13" - resolved "https://registry.yarnpkg.com/@0xproject/tslint-config/-/tslint-config-0.4.13.tgz#98c71c5ae5e80315a23eda0134cc9f6f4438cac2" - dependencies: - lodash "^4.17.4" - tslint "5.8.0" - tslint-eslint-rules "^4.1.1" - tslint-react "^3.2.0" - "@0xproject/types@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@0xproject/types/-/types-0.5.0.tgz#ba3cfbc11a8c6344b57c9680aa7df2ea84b9bf05" @@ -9875,7 +9866,7 @@ split@0.3: dependencies: through "2" -split@^1.0.0: +split@^1.0.0, split@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" dependencies: @@ -10373,6 +10364,10 @@ thenify-all@^1.0.0, thenify-all@^1.6.0: dependencies: any-promise "^1.0.0" +throat@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + through2-filter@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" @@ -11784,6 +11779,18 @@ ws@^5.1.1: dependencies: async-limiter "~1.0.0" +wsrun@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/wsrun/-/wsrun-2.2.0.tgz#fe05ca2c466e9281059d255b2773e7964dbcb3a7" + dependencies: + bluebird "^3.5.1" + chalk "^2.3.0" + glob "^7.1.2" + lodash "^4.17.4" + split "^1.0.1" + throat "^4.1.0" + yargs "^10.0.3" + x-is-function@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/x-is-function/-/x-is-function-1.0.4.tgz#5d294dc3d268cbdd062580e0c5df77a391d1fa1e" -- cgit v1.2.3 From 76f9ad0705e9d90b5bc052ee76262389ebfe2e40 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 19:24:47 +0200 Subject: Remove build from docs:stage commands --- packages/0x.js/package.json | 2 +- packages/connect/package.json | 2 +- packages/json-schemas/package.json | 2 +- packages/order-utils/package.json | 2 +- packages/sol-compiler/package.json | 2 +- packages/sol-cov/package.json | 2 +- packages/subproviders/package.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 8dcd8a6e2..028fdceaf 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -27,7 +27,7 @@ "test:commonjs": "run-s build:commonjs run_mocha", "run_mocha": "mocha lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "yarn build && node ./scripts/stage_docs.js", + "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" }, diff --git a/packages/connect/package.json b/packages/connect/package.json index 379d8f698..e2ffa09aa 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -23,7 +23,7 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "yarn build && node ./scripts/stage_docs.js", + "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" }, diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index 0926474d2..26bf2c3b0 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -15,7 +15,7 @@ "clean": "shx rm -rf lib test_temp scripts", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "yarn build && node ./scripts/stage_docs.js", + "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" }, diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 5ef0bb97d..96eb809f0 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -15,7 +15,7 @@ "clean": "shx rm -rf lib scripts", "lint": "tslint --project .", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "yarn build && node ./scripts/stage_docs.js", + "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" }, diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index fcb0b9cd0..6edec7800 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -15,7 +15,7 @@ "migrate": "npm run build; node lib/src/cli.js migrate", "lint": "tslint --project .", "test:circleci": "yarn test:coverage", - "docs:stage": "yarn build && node ./scripts/stage_docs.js", + "docs:stage": "node scripts/stage_docs.js", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index ec6207a1b..16d0330a6 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -16,7 +16,7 @@ "build": "copyfiles 'test/fixtures/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "compile_test": "node ../sol-compiler/lib/src/cli.js compile", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "yarn build && node ./scripts/stage_docs.js", + "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" }, diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index cf1ed32ec..c3ba0c8f9 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -19,7 +19,7 @@ "test:unit": "run-s clean build run_mocha_unit", "test:integration": "run-s clean build run_mocha_integration", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "yarn build && node ./scripts/stage_docs.js", + "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" }, -- cgit v1.2.3 From 5f678acf46ac024ccd6a0a6ea002e0ddf7ff3ba5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 19:31:56 +0200 Subject: Fix abi-gen binary so it can be called directly from packages --- .gitignore | 2 -- packages/0x.js/package.json | 3 ++- packages/abi-gen/bin/abi-gen.js | 2 ++ packages/abi-gen/package.json | 2 +- packages/contract-wrappers/package.json | 3 ++- packages/contracts/package.json | 3 ++- packages/fill-scenarios/package.json | 3 ++- packages/metacoin/package.json | 2 +- packages/migrations/package.json | 5 +++-- packages/order-watcher/package.json | 3 ++- 10 files changed, 17 insertions(+), 11 deletions(-) create mode 100755 packages/abi-gen/bin/abi-gen.js diff --git a/.gitignore b/.gitignore index 2c819cacf..18c3a0fb9 100644 --- a/.gitignore +++ b/.gitignore @@ -70,8 +70,6 @@ TODO.md packages/website/public/bundle* packages/react-docs/example/public/bundle* -# generated binaries -bin/ # generated contract artifacts/ packages/sol-cov/test/fixtures/artifacts/ diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 028fdceaf..167edbf67 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -15,7 +15,7 @@ "watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", "build": "run-p build:umd:prod build:commonjs; exit 0;", - "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", + "generate_contract_wrappers": "abi-gen --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", "lint": "tslint --project .", "test:circleci": "run-s test:coverage", "test": "run-s clean test:commonjs", @@ -66,6 +66,7 @@ "node": ">=6.0.0" }, "devDependencies": { + "@0xproject/abi-gen": "^0.2.13", "@0xproject/sol-compiler": "^0.4.3", "@0xproject/dev-utils": "^0.4.1", "@0xproject/migrations": "^0.0.5", diff --git a/packages/abi-gen/bin/abi-gen.js b/packages/abi-gen/bin/abi-gen.js new file mode 100755 index 000000000..c46eb9b66 --- /dev/null +++ b/packages/abi-gen/bin/abi-gen.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/index.js') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index a151ff2e2..0fa621735 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -12,7 +12,7 @@ "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, "bin": { - "abi-gen": "lib/index.js" + "abi-gen": "bin/abi-gen.js" }, "repository": { "type": "git", diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 1ebdf7252..5042a14e7 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -13,7 +13,7 @@ "scripts": { "watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", - "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", + "generate_contract_wrappers": "abi-gen --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", "lint": "tslint --project .", "test:circleci": "run-s test:coverage", "test": "run-s clean build run_mocha", @@ -44,6 +44,7 @@ "node": ">=6.0.0" }, "devDependencies": { + "@0xproject/abi-gen": "^0.2.13", "@0xproject/sol-compiler": "^0.4.3", "@0xproject/dev-utils": "^0.4.1", "@0xproject/migrations": "^0.0.5", diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 14f6e53f0..ec41f951b 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -18,7 +18,7 @@ "compile:comment": "Yarn workspaces do not link binaries correctly so we need to reference them directly https://github.com/yarnpkg/yarn/issues/3846", "compile": "node ../sol-compiler/lib/src/cli.js", "clean": "shx rm -rf lib src/contract_wrappers/generated", - "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", + "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", "lint": "tslint --project .", "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", @@ -39,6 +39,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md", "devDependencies": { + "@0xproject/abi-gen": "^0.2.13", "@0xproject/dev-utils": "^0.4.1", "@0xproject/tslint-config": "^0.4.17", "@types/lodash": "4.14.104", diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json index 0a3742e8c..2f1a46c97 100644 --- a/packages/fill-scenarios/package.json +++ b/packages/fill-scenarios/package.json @@ -7,7 +7,7 @@ "scripts": { "watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", - "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", + "generate_contract_wrappers": "abi-gen --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", "build": "tsc && copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/compact_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib scripts src/generated_contract_wrappers", "lint": "tslint --project .", @@ -23,6 +23,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md", "devDependencies": { + "@0xproject/abi-gen": "^0.2.13", "@0xproject/monorepo-scripts": "^0.1.19", "@0xproject/sol-compiler": "^0.4.3", "@0xproject/tslint-config": "^0.4.17", diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index 204d940ad..e000b8a56 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -13,7 +13,7 @@ "test": "run-s build run_mocha", "test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov", "run_mocha": "mocha lib/test/**/*_test.js lib/test/global_hooks.js --bail --exit", - "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'artifacts/Metacoin.json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers && prettier --write 'src/contract_wrappers/**.ts'", + "generate_contract_wrappers": "abi-gen --abis 'artifacts/Metacoin.json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers && prettier --write 'src/contract_wrappers/**.ts'", "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", diff --git a/packages/migrations/package.json b/packages/migrations/package.json index 5eaa9530c..ca044e0ca 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -14,14 +14,15 @@ "migrate": "run-s build compile script:migrate", "script:migrate": "node ./lib/migrate.js", "copy_artifacts": "copyfiles 'artifacts/1.0.0/**/*' ./lib", - "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers && prettier --write 'src/contract_wrappers/**.ts'", - "compile": "node ../sol-compiler/lib/src/cli.js compile" + "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers && prettier --write 'src/contract_wrappers/**.ts'", + "compile": "sol-compiler" }, "config": { "abis": "artifacts/1.0.0/@(DummyToken|TokenTransferProxy|Exchange|TokenRegistry|MultiSigWallet|MultiSigWalletWithTimeLock|MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress|TokenRegistry|ZRXToken|Arbitrage|EtherDelta|AccountLevels|WETH9|MaliciousToken).json" }, "license": "Apache-2.0", "devDependencies": { + "@0xproject/abi-gen": "^0.2.13", "@0xproject/dev-utils": "^0.4.1", "@0xproject/types": "^0.6.3", "@0xproject/tslint-config": "^0.4.17", diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 0ac9f8592..50aaffd7f 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -14,7 +14,7 @@ "scripts": { "watch": "tsc -w", "prebuild": "run-s clean generate_contract_wrappers", - "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", + "generate_contract_wrappers": "abi-gen --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated_contract_wrappers --backend ethers && prettier --write 'src/generated_contract_wrappers/**.ts'", "lint": "tslint --project .", "test:circleci": "run-s test:coverage", "test": "run-s clean build run_mocha", @@ -45,6 +45,7 @@ "node": ">=6.0.0" }, "devDependencies": { + "@0xproject/abi-gen": "^0.2.13", "@0xproject/sol-compiler": "^0.4.3", "@0xproject/dev-utils": "^0.4.1", "@0xproject/migrations": "^0.0.5", -- cgit v1.2.3 From a6773b85d2a518c5bc636d889a20ee31bd809cc7 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 19:32:32 +0200 Subject: Fix sol-compiler binary so it can be called directly from packages --- packages/contracts/package.json | 2 +- packages/metacoin/package.json | 2 +- packages/sol-compiler/bin/sol-compiler.js | 2 ++ packages/sol-compiler/package.json | 2 +- packages/sol-cov/package.json | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100755 packages/sol-compiler/bin/sol-compiler.js diff --git a/packages/contracts/package.json b/packages/contracts/package.json index ec41f951b..cdd5417c4 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -16,7 +16,7 @@ "test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov", "run_mocha": "mocha 'lib/test/**/*.js' --timeout 100000 --bail --exit", "compile:comment": "Yarn workspaces do not link binaries correctly so we need to reference them directly https://github.com/yarnpkg/yarn/issues/3846", - "compile": "node ../sol-compiler/lib/src/cli.js", + "compile": "sol-compiler", "clean": "shx rm -rf lib src/contract_wrappers/generated", "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", "lint": "tslint --project .", diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index e000b8a56..387eeff50 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -18,7 +18,7 @@ "coverage:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test:coverage", - "compile": "node ../sol-compiler/lib/src/cli.js compile" + "compile": "sol-compiler compile" }, "author": "", "license": "Apache-2.0", diff --git a/packages/sol-compiler/bin/sol-compiler.js b/packages/sol-compiler/bin/sol-compiler.js new file mode 100755 index 000000000..0e5b69af0 --- /dev/null +++ b/packages/sol-compiler/bin/sol-compiler.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/src/cli.js') diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 6edec7800..30e9a47c8 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -33,7 +33,7 @@ } }, "bin": { - "sol-compiler": "lib/src/cli.js" + "sol-compiler": "bin/sol-compiler.js" }, "repository": { "type": "git", diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 16d0330a6..cc513c1bd 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -14,7 +14,7 @@ "run_mocha": "mocha lib/test/**/*_test.js --exit", "clean": "shx rm -rf lib scripts test/fixtures/artifacts src/artifacts", "build": "copyfiles 'test/fixtures/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", - "compile_test": "node ../sol-compiler/lib/src/cli.js compile", + "compile_test": "sol-compiler compile", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", -- cgit v1.2.3 From 09d33792f35db005eb4d2d80620043a523f66246 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 19:32:52 +0200 Subject: rename build:watch to watch and remove build from docs:stage --- packages/web3-wrapper/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index bc38df00d..59a526b93 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -5,7 +5,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "build:watch": "tsc -w", + "watch": "tsc -w", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "clean": "shx rm -rf lib scripts", "lint": "tslint --project .", @@ -15,7 +15,7 @@ "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "yarn build && node ./scripts/stage_docs.js", + "docs:stage": "node scripts/stage_docs.js", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" }, -- cgit v1.2.3 From 5f72b86ce427c6361bacc852002b777fd1d6defa Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 19:33:23 +0200 Subject: Fix sra-report binary --- packages/sra-report/bin/sra-report.js | 2 ++ packages/sra-report/package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 packages/sra-report/bin/sra-report.js diff --git a/packages/sra-report/bin/sra-report.js b/packages/sra-report/bin/sra-report.js new file mode 100755 index 000000000..8d6bdccf8 --- /dev/null +++ b/packages/sra-report/bin/sra-report.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/src/index.js') diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json index 5f8701997..f472aaaae 100644 --- a/packages/sra-report/package.json +++ b/packages/sra-report/package.json @@ -16,7 +16,7 @@ "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, "bin": { - "sra-report": "lib/src/index.js" + "sra-report": "bin/sra-report.js" }, "repository": { "type": "git", -- cgit v1.2.3 From 8cb074657d39352314d614f6cb27e3aaf56b8de6 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 19:33:45 +0200 Subject: Rename bin to server in testnet-faucets since bin is no longer gitignored --- .gitignore | 2 ++ packages/testnet-faucets/Dockerfile | 2 +- packages/testnet-faucets/gulpfile.js | 6 +++--- packages/testnet-faucets/package.json | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 18c3a0fb9..5d0b845ce 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,8 @@ TODO.md packages/website/public/bundle* packages/react-docs/example/public/bundle* +# server cli +packages/testnet-faucets/server/ # generated contract artifacts/ packages/sol-cov/test/fixtures/artifacts/ diff --git a/packages/testnet-faucets/Dockerfile b/packages/testnet-faucets/Dockerfile index bd1dcc4a4..198087ba6 100644 --- a/packages/testnet-faucets/Dockerfile +++ b/packages/testnet-faucets/Dockerfile @@ -15,4 +15,4 @@ COPY . . EXPOSE 3000 -CMD ["forever", "./bin/server.js"] +CMD ["forever", "./server/server.js"] diff --git a/packages/testnet-faucets/gulpfile.js b/packages/testnet-faucets/gulpfile.js index 773faf33a..7c4e25e0f 100644 --- a/packages/testnet-faucets/gulpfile.js +++ b/packages/testnet-faucets/gulpfile.js @@ -9,7 +9,7 @@ const config = { target: 'node', entry: [path.join(__dirname, '/src/ts/server.ts')], output: { - path: path.join(__dirname, '/bin'), + path: path.join(__dirname, '/server'), filename: 'server.js', }, devtool: 'source-map', @@ -47,7 +47,7 @@ const config = { modulesDir: path.join(__dirname, '../../node_modules') }), watchOptions: { - ignored: /bin|node_modules|transpiled/ + ignored: /server|node_modules|transpiled/ }, }; @@ -67,7 +67,7 @@ gulp.task('run', ['watch'], function() { execMap: { js: 'node', }, - script: path.join(__dirname, 'bin/server'), + script: path.join(__dirname, 'server/server'), ignore: ['*'], watch: ['foo/'], ext: 'noop', diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index f00ffad02..c7663fe13 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -8,9 +8,9 @@ "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", + "start": "node ./server/server.js", "lint": "tslint --project .", - "clean": "shx rm -rf bin" + "clean": "shx rm -rf server" }, "author": "Fabio Berger", "license": "Apache-2.0", -- cgit v1.2.3 From 1e7003a3070930da2b3aca88fd2398126457efe6 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 19:57:41 +0200 Subject: Add changelog entries for packages where executable binary exporting fixed --- packages/abi-gen/CHANGELOG.json | 9 +++++++++ packages/sol-compiler/CHANGELOG.json | 9 +++++++++ packages/sra-report/CHANGELOG.json | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json index 4dada9cc1..4b23b8118 100644 --- a/packages/abi-gen/CHANGELOG.json +++ b/packages/abi-gen/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "0.3.0", + "changes": [ + { + "note": "Properly export the executable binary", + "pr": 588 + } + ] + }, { "timestamp": 1525477860, "version": "0.2.13", diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index 3f18ae121..a1b53fb9e 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "0.5.0", + "changes": [ + { + "note": "Properly export the executable binary", + "pr": 588 + } + ] + }, { "timestamp": 1525477860, "version": "0.4.3", diff --git a/packages/sra-report/CHANGELOG.json b/packages/sra-report/CHANGELOG.json index 22aa8ce16..90a807c85 100644 --- a/packages/sra-report/CHANGELOG.json +++ b/packages/sra-report/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "0.1.0", + "changes": [ + { + "note": "Properly export the executable binary", + "pr": 588 + } + ] + }, { "timestamp": 1525477860, "version": "0.0.14", -- cgit v1.2.3 From 7c023233f201852c7f20117b2a358f47e462ae1a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 20:02:41 +0200 Subject: Fix infinite loop --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 231371623..6d90b72fd 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "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", - "publish": "run-s install rebuild script:publish", - "publish:dry": "run-s install rebuild script:publish:dry", + "publish": "run-s install:all rebuild script:publish", + "publish:dry": "run-s install:all rebuild script:publish:dry", "script:publish": "node ./packages/monorepo-scripts/lib/publish.js", "script:publish:dry": "IS_DRY_RUN=true yarn script:publish", - "install": "yarn install", + "install:all": "yarn install", "wsrun": "wsrun", "watch": "wsrun watch $PKG -r --stages --done-criteria='complete|successfully'", "build": "wsrun build $PKG -r --stages", -- cgit v1.2.3 From d0905eda496864096f5a64b1e2c1c05b575be904 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 14 May 2018 21:48:46 +0200 Subject: Fix TSLint issues --- packages/contract-wrappers/test/global_hooks.ts | 2 +- packages/contract-wrappers/test/utils/chai_setup.ts | 2 +- packages/dev-utils/src/callback_error_reporter.ts | 15 ++++++++++++--- packages/monorepo-scripts/src/postpublish_utils.ts | 10 +++++----- packages/monorepo-scripts/src/publish.ts | 8 ++++---- packages/monorepo-scripts/src/utils.ts | 4 ++-- packages/order-watcher/src/utils/assert.ts | 2 +- packages/order-watcher/test/global_hooks.ts | 2 +- packages/order-watcher/test/utils/chai_setup.ts | 2 +- 9 files changed, 28 insertions(+), 19 deletions(-) diff --git a/packages/contract-wrappers/test/global_hooks.ts b/packages/contract-wrappers/test/global_hooks.ts index 88f202761..53b3ef545 100644 --- a/packages/contract-wrappers/test/global_hooks.ts +++ b/packages/contract-wrappers/test/global_hooks.ts @@ -5,7 +5,7 @@ import * as path from 'path'; import { constants } from './utils/constants'; import { provider } from './utils/web3_wrapper'; -before('migrate contracts', async function() { +before('migrate contracts', async function(): Promise { // HACK: Since the migrations take longer then our global mocha timeout limit // we manually increase it for this before hook. this.timeout(20000); diff --git a/packages/contract-wrappers/test/utils/chai_setup.ts b/packages/contract-wrappers/test/utils/chai_setup.ts index 078edd309..1a8733093 100644 --- a/packages/contract-wrappers/test/utils/chai_setup.ts +++ b/packages/contract-wrappers/test/utils/chai_setup.ts @@ -4,7 +4,7 @@ import ChaiBigNumber = require('chai-bignumber'); import * as dirtyChai from 'dirty-chai'; export const chaiSetup = { - configure() { + configure(): void { chai.config.includeStack = true; chai.use(ChaiBigNumber()); chai.use(dirtyChai); diff --git a/packages/dev-utils/src/callback_error_reporter.ts b/packages/dev-utils/src/callback_error_reporter.ts index c8e693673..8432bb5d4 100644 --- a/packages/dev-utils/src/callback_error_reporter.ts +++ b/packages/dev-utils/src/callback_error_reporter.ts @@ -6,7 +6,10 @@ import { DoneCallback } from '@0xproject/types'; const expect = chai.expect; export const callbackErrorReporter = { - reportNoErrorCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) { + reportNoErrorCallbackErrors( + done: DoneCallback, + expectToBeCalledOnce: boolean = true, + ): (f?: ((value: T) => void) | undefined) => (value: T) => void { const callback = (f?: (value: T) => void) => { const wrapped = (value: T) => { if (_.isUndefined(f)) { @@ -26,7 +29,10 @@ export const callbackErrorReporter = { }; return callback; }, - reportNodeCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) { + reportNodeCallbackErrors( + done: DoneCallback, + expectToBeCalledOnce: boolean = true, + ): (f?: ((value: T) => void) | undefined) => (error: Error | null, value: T | undefined) => void { const callback = (f?: (value: T) => void) => { const wrapped = (error: Error | null, value: T | undefined) => { if (!_.isNull(error)) { @@ -50,7 +56,10 @@ export const callbackErrorReporter = { }; return callback; }, - assertNodeCallbackError(done: DoneCallback, errMsg: string) { + assertNodeCallbackError( + done: DoneCallback, + errMsg: string, + ): (error: Error | null, value: T | undefined) => void { const wrapped = (error: Error | null, value: T | undefined) => { if (_.isNull(error)) { done(new Error('Expected callback to receive an error')); diff --git a/packages/monorepo-scripts/src/postpublish_utils.ts b/packages/monorepo-scripts/src/postpublish_utils.ts index df2bcb128..5fbff938e 100644 --- a/packages/monorepo-scripts/src/postpublish_utils.ts +++ b/packages/monorepo-scripts/src/postpublish_utils.ts @@ -74,7 +74,7 @@ export const postpublishUtils = { utils.log(`POSTPUBLISH: No S3Bucket config found for ${packageJSON.name}. Skipping doc JSON generation.`); } }, - async publishDocsToStagingAsync(packageJSON: any, tsConfigJSON: any, cwd: string) { + async publishDocsToStagingAsync(packageJSON: any, tsConfigJSON: any, cwd: string): Promise { const configs = this.generateConfig(packageJSON, tsConfigJSON, cwd); if (_.isUndefined(configs.docPublishConfigs.s3StagingBucketPath)) { utils.log('config.postpublish.docPublishConfigs.s3StagingBucketPath entry in package.json not found!'); @@ -109,7 +109,7 @@ export const postpublishUtils = { assets, }); }, - getReleaseNotes(packageName: string, version: string) { + getReleaseNotes(packageName: string, version: string): string { const packageNameWithNamespace = packageName.replace('@0xproject/', ''); const changelogJSONPath = path.join( constants.monorepoRootPath, @@ -135,14 +135,14 @@ export const postpublishUtils = { }); return notes; }, - getTag(packageName: string, version: string) { + getTag(packageName: string, version: string): string { return `${packageName}@${version}`; }, getReleaseName(subPackageName: string, version: string): string { const releaseName = `${subPackageName} v${version}`; return releaseName; }, - adjustAssetPaths(cwd: string, assets: string[]) { + adjustAssetPaths(cwd: string, assets: string[]): string[] { const finalAssets: string[] = []; _.each(assets, (asset: string) => { finalAssets.push(`${cwd}/${asset}`); @@ -164,7 +164,7 @@ export const postpublishUtils = { }); return fileIncludesAdjusted; }, - async generateAndUploadDocsAsync(cwd: string, fileIncludes: string[], version: string, S3BucketPath: string) { + async generateAndUploadDocsAsync(cwd: string, fileIncludes: string[], version: string, S3BucketPath: string): Promise { const fileIncludesAdjusted = this.adjustFileIncludePaths(fileIncludes, cwd); const projectFiles = fileIncludesAdjusted.join(' '); const jsonFilePath = `${cwd}/${generatedDocsDirectoryName}/index.json`; diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index 31c85e3cc..5c26475c9 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -72,7 +72,7 @@ const packageNameToWebsitePath: { [name: string]: string } = { process.exit(1); }); -async function confirmDocPagesRenderAsync(packages: LernaPackage[]) { +async function confirmDocPagesRenderAsync(packages: LernaPackage[]): Promise { // push docs to staging utils.log("Upload all docJson's to S3 staging..."); await execAsync(`yarn stage_docs`, { cwd: constants.monorepoRootPath }); @@ -162,7 +162,7 @@ async function checkPublishRequiredSetupAsync(): Promise { return true; } -async function pushChangelogsToGithubAsync() { +async function pushChangelogsToGithubAsync(): Promise { await execAsync(`git add . --all`, { cwd: constants.monorepoRootPath }); await execAsync(`git commit -m "Updated CHANGELOGS"`, { cwd: constants.monorepoRootPath }); await execAsync(`git push`, { cwd: constants.monorepoRootPath }); @@ -228,7 +228,7 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[]) return packageToVersionChange; } -async function lernaPublishAsync(packageToVersionChange: { [name: string]: string }) { +async function lernaPublishAsync(packageToVersionChange: { [name: string]: string }): Promise { // 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/'], { @@ -269,7 +269,7 @@ async function lernaPublishAsync(packageToVersionChange: { [name: string]: strin }); } -function updateVersionNumberIfNeeded(currentVersion: string, proposedNextVersion: string) { +function updateVersionNumberIfNeeded(currentVersion: string, proposedNextVersion: string): string { if (proposedNextVersion === currentVersion) { return utils.getNextPatchVersion(currentVersion); } diff --git a/packages/monorepo-scripts/src/utils.ts b/packages/monorepo-scripts/src/utils.ts index 4412f753a..480788ad8 100644 --- a/packages/monorepo-scripts/src/utils.ts +++ b/packages/monorepo-scripts/src/utils.ts @@ -17,7 +17,7 @@ export const utils = { const newPatchVersion = `${versionSegments[0]}.${versionSegments[1]}.${newPatch}`; return newPatchVersion; }, - async prettifyAsync(filePath: string, cwd: string) { + async prettifyAsync(filePath: string, cwd: string): Promise { await execAsync(`prettier --write ${filePath} --config .prettierrc`, { cwd, }); @@ -43,7 +43,7 @@ export const utils = { } return updatedPackages; }, - getChangelogJSONIfExists(changelogPath: string) { + getChangelogJSONIfExists(changelogPath: string): string|undefined { try { const changelogJSON = fs.readFileSync(changelogPath, 'utf-8'); return changelogJSON; diff --git a/packages/order-watcher/src/utils/assert.ts b/packages/order-watcher/src/utils/assert.ts index f96bcebc1..9e02f8bdc 100644 --- a/packages/order-watcher/src/utils/assert.ts +++ b/packages/order-watcher/src/utils/assert.ts @@ -12,7 +12,7 @@ import { isValidSignature } from '@0xproject/order-utils'; export const assert = { ...sharedAssert, - isValidSignature(orderHash: string, ecSignature: ECSignature, signerAddress: string) { + isValidSignature(orderHash: string, ecSignature: ECSignature, signerAddress: string): void { const isValid = isValidSignature(orderHash, ecSignature, signerAddress); this.assert(isValid, `Expected order with hash '${orderHash}' to have a valid signature`); }, diff --git a/packages/order-watcher/test/global_hooks.ts b/packages/order-watcher/test/global_hooks.ts index 88f202761..53b3ef545 100644 --- a/packages/order-watcher/test/global_hooks.ts +++ b/packages/order-watcher/test/global_hooks.ts @@ -5,7 +5,7 @@ import * as path from 'path'; import { constants } from './utils/constants'; import { provider } from './utils/web3_wrapper'; -before('migrate contracts', async function() { +before('migrate contracts', async function(): Promise { // HACK: Since the migrations take longer then our global mocha timeout limit // we manually increase it for this before hook. this.timeout(20000); diff --git a/packages/order-watcher/test/utils/chai_setup.ts b/packages/order-watcher/test/utils/chai_setup.ts index 078edd309..1a8733093 100644 --- a/packages/order-watcher/test/utils/chai_setup.ts +++ b/packages/order-watcher/test/utils/chai_setup.ts @@ -4,7 +4,7 @@ import ChaiBigNumber = require('chai-bignumber'); import * as dirtyChai from 'dirty-chai'; export const chaiSetup = { - configure() { + configure(): void { chai.config.includeStack = true; chai.use(ChaiBigNumber()); chai.use(dirtyChai); -- cgit v1.2.3 From 03b5b0912264116c5aeec8c8756acc0a17f82624 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 15 May 2018 10:43:41 +0200 Subject: Fix prettier --- README.md | 14 ++++++++++++++ packages/contract-wrappers/README.md | 2 -- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd7fd44b1..3486bf161 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,13 @@ We strongly recommend that the community help us make improvements and determine ### Install dependencies If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: + ```bash yarn config set workspaces-experimental true ``` Then install dependencies + ```bash yarn install ``` @@ -90,11 +92,13 @@ yarn install ### Build To build all packages: + ```bash yarn build ``` To build a specific package: + ```bash PKG=@0xproject/web3-wrapper yarn build ``` @@ -102,11 +106,13 @@ PKG=@0xproject/web3-wrapper yarn build ### Watch To re-build all packages on change: + ```bash yarn watch ``` To watch a specific package and all it's dependent packages: + ```bash PKG=[NPM_PACKAGE_NAME] yarn watch @@ -117,11 +123,13 @@ PKG=@0xproject/web3-wrapper yarn watch ### Clean Clean all packages: + ```bash yarn clean ``` Clean a specific package + ```bash PKG=0x.js yarn clean ``` @@ -129,11 +137,13 @@ PKG=0x.js yarn clean ### Rebuild To re-build (clean & build) all packages: + ```bash yarn rebuild ``` To re-build (clean & build) a specific package & it's deps: + ```bash PKG=0x.js yarn rebuild ``` @@ -141,11 +151,13 @@ PKG=0x.js yarn rebuild ### Lint Lint all packages: + ```bash yarn lint ``` Lint a specific package: + ```bash PKG=0x.js yarn lint ``` @@ -153,11 +165,13 @@ PKG=0x.js yarn lint ### Run Tests Run all tests: + ```bash yarn test ``` Run a specific package's test: + ```bash PKG=@0xproject/web3-wrapper yarn test ``` diff --git a/packages/contract-wrappers/README.md b/packages/contract-wrappers/README.md index 4d7820056..6153f798e 100644 --- a/packages/contract-wrappers/README.md +++ b/packages/contract-wrappers/README.md @@ -60,8 +60,6 @@ Or continuously rebuild on change: PKG=@0xproject/contract-wrappers yarn watch ``` - - ```bash yarn build ``` -- cgit v1.2.3 From 323955277c01b29794038caa7119f59fd60ba717 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 15 May 2018 10:47:00 +0200 Subject: Exclude monorepo-scripts from tslint as test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6bf897c1c..2c138599e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -136,7 +136,7 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn wsrun lint --parallel --exclude-missing + - run: yarn wsrun lint --parallel --exclude-missing --exclude @0xproject/monorepo-scripts prettier: working_directory: ~/repo docker: -- cgit v1.2.3 From 7474e6b1c95c4618b7180b66777e976b5984467f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 15 May 2018 11:05:02 +0200 Subject: Do lint sequentially --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c138599e..b15822925 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -136,7 +136,7 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn wsrun lint --parallel --exclude-missing --exclude @0xproject/monorepo-scripts + - run: yarn wsrun lint --exclude-missing prettier: working_directory: ~/repo docker: -- cgit v1.2.3 From 473acafd1457a381405335dae80a3a8e810af17b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 15 May 2018 11:21:49 +0200 Subject: Revert to lerna:run lint --- .circleci/config.yml | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b15822925..58740062a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -136,7 +136,7 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn wsrun lint --exclude-missing + - run: yarn lerna:run lint prettier: working_directory: ~/repo docker: diff --git a/package.json b/package.json index aa9031ae9..a550c3f58 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "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", -- cgit v1.2.3