From 3d6c0b75a1583838873c04b03a5f410804960220 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 01:47:03 +0100 Subject: Improve package descriptions --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 904dcb604..cf12280b8 100644 --- a/README.md +++ b/README.md @@ -22,21 +22,21 @@ This repository contains all the 0x developer tools written in TypeScript. Our h | Package | Version | Description | |---------|---------|-------------| | [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol | -| [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS code from ABI | -| [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Standard type and schema assertions | +| [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs | +| [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages | | [`@0xproject/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0xproject/connect.svg)](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the standard relayer api | | [`@0xproject/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0xproject/json-schemas.svg)](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas | -| [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Web3 subproviders | -| [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x project TSLint rules | -| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared types | -| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utils | +| [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) | +| [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules | +| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations | +| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities | | [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0xproject/web3-wrapper.svg)](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper | ### Private Packages | Package | Description | |---------|-------------| -| [`@0xproject/contracts`](/packages/contracts) | Smart contracts | +| [`@0xproject/contracts`](/packages/contracts) | 0x solidity smart contracts & tests | | [`@0xproject/kovan_faucets`](/packages/kovan-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether | | [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | Shared monorepo scripts | -| [`@0xproject/website`](/packages/website) | 0x website | +| [`@0xproject/website`](/packages/website) | 0x website & Portal DApp | -- cgit v1.2.3 From b799a8a108646fc097595291b4697976f6a0d25c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 02:14:44 +0100 Subject: Flesh out main repo README --- README.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/README.md b/README.md index cf12280b8..bd24d3c3f 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,65 @@ This repository contains all the 0x developer tools written in TypeScript. Our h | [`@0xproject/kovan_faucets`](/packages/kovan-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether | | [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | Shared monorepo scripts | | [`@0xproject/website`](/packages/website) | 0x website & Portal DApp | + +## Usage + +Dedicated documentation pages: +- [0x.js Library](https://0xproject.com/docs/0xjs) +- [0x Connect](https://0xproject.com/docs/connect) +- [Smart contracts](https://0xproject.com/docs/contracts) +- [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/blob/master/README.md) + +## Contributing + +We strongly encourage the community to help us make improvements and to determine the future direction of the protocol. 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 + +Build all packages + +```bash +yarn lerna:run build +``` + +### Lint + +Lint all packages +```bash +yarn lerna:run lint +``` + +### Run Tests + +Before running the tests, you will need to spin up a [TestRPC](https://www.npmjs.com/package/ethereumjs-testrpc) instance and deploy all the 0x smart contracts. + +In a separate terminal, start TestRPC (a convenience command is provided as part of this repo) +```bash +yarn testrpc +``` + +Then in your main terminal run +``` +cd packages/contracts +yarn run migrate +cd .. +``` + +And finally from the root project directory run +```bash +yarn lerna:run test +``` -- cgit v1.2.3 From 53798302da8dd42bd28817bc159d235a291497a5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 02:24:17 +0100 Subject: Improve subproviders readme --- packages/subproviders/README.md | 58 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index 5fa31611a..73d61df42 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -1,15 +1,23 @@ -Subproviders ------------ +@0xproject/subproviders +-------- -A few useful subproviders. +A few useful web3 subproviders including a LedgerSubprovider useful for adding Ledger Nano S support. ## Installation ``` -npm install @0xproject/subproviders --save +yarn add @0xproject/subproviders ``` -## Subproviders +## Usage + +Simply import the subprovider you are interested in using: + +```javascript +import {LedgerSubprovider} from '@0xproject/subproviders'; +``` + +### Subproviders #### Ledger Nano S subprovider @@ -23,7 +31,39 @@ A subprovider which attempts to send an RPC call to a list of RPC endpoints sequ A subprovider that relays all signing related requests to a particular provider (in our case the provider injected onto the web page), while sending all other requests to a different provider (perhaps your own backing Ethereum node or Infura). -### Integration tests +## Contributing + +We strongly encourage the community to help us make improvements and to determine the future direction of the protocol. 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 + +```bash +yarn install +``` + +### Build + +```bash +yarn build +``` + +### Lint + +```bash +yarn lint +``` + +### Run tests + +#### Unit tests + +```bash +yarn run test:unit +``` + +#### Integration tests In order to run the integration tests, make sure you have a Ledger Nano S available. @@ -37,3 +77,9 @@ Then run: ``` yarn test:integration ``` + +#### All tests + +```bash +yarn run test:all +``` -- cgit v1.2.3 From c75eaca5b676d42e1c0ada765a7ff8369c728ff9 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 02:37:02 +0100 Subject: Add clean instructions --- packages/subproviders/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index 73d61df42..2d7483b16 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -49,6 +49,12 @@ yarn install yarn build ``` +### Clean + +```bash +yarn clean +``` + ### Lint ```bash -- cgit v1.2.3 From 5d240222093dafd9c9d2db24e66668b4214c1b8e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 02:37:14 +0100 Subject: Add mono repo scripts README --- packages/monorepo-scripts/README.md | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 packages/monorepo-scripts/README.md diff --git a/packages/monorepo-scripts/README.md b/packages/monorepo-scripts/README.md new file mode 100644 index 000000000..d2299b70d --- /dev/null +++ b/packages/monorepo-scripts/README.md @@ -0,0 +1,51 @@ +Mono repo scripts +------ + +This repository contains a few helpful scripts for working with this mono repo. + +## Usage + +#### Dependency versions +In order to reduce the size of this repo, we try and use the same versions of dependencies between packages. To make it easier to discover version discrepancies between packages, you can run: + +```bash +yarn deps_versions +``` + +This will list out any dependencies that differ in versions between packages. + +## Contributing + +We strongly recommend the community to help us make improvements and to determine the future direction of the protocol. 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 + +```bash +yarn build +``` + +### Clean + +```bash +yarn clean +``` + +### Lint + +```bash +yarn lint +``` -- cgit v1.2.3 From dd39fadce7917d946f1d56ed19defaa2d68e26a5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 02:49:36 +0100 Subject: Update and improve website README --- packages/website/README.md | 56 +++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/packages/website/README.md b/packages/website/README.md index 40df07cb7..53cdbd8d3 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -1,8 +1,5 @@ - - ---- - -[0x][website-url] is an open protocol that facilitates trustless, low friction exchange of Ethereum-based assets. A full description of the protocol may be found in our [whitepaper][whitepaper-url]. +Website & 0x Portal DApp +----- This repository contains our website and [0x Portal DApp][portal-url] (over-the-counter exchange), facilitating trustless over-the-counter trading of Ethereum-based tokens using 0x protocol. @@ -10,51 +7,58 @@ This repository contains our website and [0x Portal DApp][portal-url] (over-the- [whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf [portal-url]: https://0xproject.com/portal -[![Join the chat at https://gitter.im/0xProject/contracts](https://badges.gitter.im/0xProject/contracts.svg)](https://gitter.im/0xProject/contracts?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) -### Local Dev Setup +## Local Dev Setup Requires Node version 6.9.5 or higher. Add the following to your `/etc/hosts` file: ``` -127.0.0.1 0xproject.dev +127.0.0.1 0xproject.localhost ``` -Clone the [0x contracts repo](https://github.com/0xProject/contracts) into the same parent directory as this project. +### Install dependencies: -Install [yarn](https://yarnpkg.com/lang/en/docs/install/) in order to install the project dependencies more deterministically. +```bash +yarn install +``` -Install dependencies: +### Run dev server -``` -yarn +```bash +yarn run dev ``` -Import smart contract artifacts from `contracts` repo: +Visit [0xproject.localhost:3572](http://0xproject.localhost:3572) in your browser. -``` -yarn run update_contracts +### Build + +```bash +yarn build ``` -Start dev server: +### Clean +```bash +yarn clean ``` -yarn run dev + +### Lint + +```bash +yarn lint ``` -Visit [0xproject.dev:3572](http://0xproject.dev:3572) in your browser. +### Resources + +##### Toolkit +- [Material Design Icon Font](http://zavoloklom.github.io/material-design-iconic-font/icons.html#directional) +- [BassCSS toolkit](http://basscss.com/) +- [Material-UI component library](http://www.material-ui.com/#/) ##### Recommended Atom packages: - [atom-typescript](https://atom.io/packages/atom-typescript) - [linter-tslint](https://atom.io/packages/linter-tslint) - -##### Resources - -- [Material Design Icon Font](http://zavoloklom.github.io/material-design-iconic-font/icons.html#directional) -- [BassCSS toolkit](http://basscss.com/) -- [Material-UI](http://www.material-ui.com/#/) -- cgit v1.2.3 From 317194322897b0fc3b7cacaa1a825209a7d74d41 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 14:50:08 +0100 Subject: Fix command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd24d3c3f..3b9b0c690 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ yarn testrpc Then in your main terminal run ``` cd packages/contracts -yarn run migrate +yarn migrate cd .. ``` -- cgit v1.2.3 From a0f5ceddce1ae33f388891b1ceff1d88e0217f1c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 14:50:20 +0100 Subject: Flesh out LedgerSubprovider usage example --- packages/subproviders/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index 2d7483b16..2baa73990 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -14,7 +14,17 @@ yarn add @0xproject/subproviders Simply import the subprovider you are interested in using: ```javascript -import {LedgerSubprovider} from '@0xproject/subproviders'; +import { + ledgerEthereumBrowserClientFactoryAsync as ledgerEthereumClientFactoryAsync, + LedgerSubprovider, +} from '@0xproject/subproviders'; + +const ledgerSubprovider = new LedgerSubprovider( + networkId, + ledgerEthereumClientFactoryAsync, +); + +const accounts = await ledgerSubprovider.getAccountsAsync(); ``` ### Subproviders -- cgit v1.2.3 From 23aa3ec5eaa25e8afd24ddf048889d1c44940a70 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 14:51:04 +0100 Subject: Add Yarn < v1.0 disclaimer --- packages/subproviders/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index 2baa73990..5d74de9d1 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -49,6 +49,11 @@ Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting ### Install Dependencies +If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: +```bash +yarn config set workspaces-experimental true +``` + ```bash yarn install ``` -- cgit v1.2.3 From 1d430cf62fa6e957c15fbdf77524c6527d8df319 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 20 Dec 2017 14:53:50 +0100 Subject: Standardize on improved contributing section --- README.md | 2 +- packages/monorepo-scripts/README.md | 2 +- packages/subproviders/README.md | 2 +- packages/website/README.md | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3b9b0c690..2715a9e30 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Dedicated documentation pages: ## Contributing -We strongly encourage the community to help us make improvements and to determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. +We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. diff --git a/packages/monorepo-scripts/README.md b/packages/monorepo-scripts/README.md index d2299b70d..452e0f94c 100644 --- a/packages/monorepo-scripts/README.md +++ b/packages/monorepo-scripts/README.md @@ -16,7 +16,7 @@ This will list out any dependencies that differ in versions between packages. ## Contributing -We strongly recommend the community to help us make improvements and to determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. +We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index 5d74de9d1..9f01b4453 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -43,7 +43,7 @@ A subprovider that relays all signing related requests to a particular provider ## Contributing -We strongly encourage the community to help us make improvements and to determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. +We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. diff --git a/packages/website/README.md b/packages/website/README.md index 53cdbd8d3..c050c6387 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -7,6 +7,11 @@ This repository contains our website and [0x Portal DApp][portal-url] (over-the- [whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf [portal-url]: https://0xproject.com/portal +## Contributing + +We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. + +Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. ## Local Dev Setup -- cgit v1.2.3