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

Commit e515373

Browse files
committed
Merge branch 'development'
* development: (939 commits) Add asset-buyer to published packages section in README Publish Updated CHANGELOGS Update BuyQuote interface force re-build Add website build to instructions Revert format and re-add changes Build website in parallel with other tests since no other test relies on it being built to run Add back sourceMap support for both dev/prod Upgrade webpack Add missing default options Remove unused constants Add fee order with a takerFee Add additional order factory methods and refactor test to use them Add comments about buy quote calculation Update CHANGELOG Fix linter Add additional test for slippage Add buy_quote_calculator_test Add 0x Instant to bundle analysis ...
2 parents 88766a0 + b04b649 commit e515373

File tree

810 files changed

+44727
-176226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

810 files changed

+44727
-176226
lines changed

.circleci/config.yml

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: 2
22

33
jobs:
44
build:
5+
resource_class: medium+
56
docker:
67
- image: circleci/node:9
78
environment:
@@ -10,31 +11,26 @@ jobs:
1011
steps:
1112
- checkout
1213
- run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV
13-
- restore_cache:
14-
name: Restore Yarn Package Cache
15-
keys:
16-
- yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
17-
- yarn-packages-{{ .Branch }}
18-
- yarn-packages-master
19-
- yarn-packages-
14+
- run:
15+
name: install-yarn
16+
command: sudo npm install --global [email protected]
2017
- run:
2118
name: yarn
22-
command: yarn --frozen-lockfile install
23-
- save_cache:
24-
name: Save Yarn Package Cache
25-
key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
26-
paths:
27-
- node_modules/
28-
- run: >
29-
if [ -z "$(git diff --name-only v2-prototype packages/website)" ]; then
30-
yarn build --exclude website
31-
else
32-
yarn build
33-
fi
19+
command: yarn --frozen-lockfile install || yarn --frozen-lockfile install
20+
- run: yarn build:ci:no_website
3421
- save_cache:
3522
key: repo-{{ .Environment.CIRCLE_SHA1 }}
3623
paths:
3724
- ~/repo
25+
build-website:
26+
docker:
27+
- image: circleci/node:9
28+
working_directory: ~/repo
29+
steps:
30+
- restore_cache:
31+
keys:
32+
- repo-{{ .Environment.CIRCLE_SHA1 }}
33+
- run: cd packages/website && yarn build
3834
test-contracts-ganache:
3935
docker:
4036
- image: circleci/node:9
@@ -47,7 +43,7 @@ jobs:
4743
test-contracts-geth:
4844
docker:
4945
- image: circleci/node:9
50-
- image: albrow/0x-devnet
46+
- image: 0xorg/devnet
5147
working_directory: ~/repo
5248
steps:
5349
- restore_cache:
@@ -57,15 +53,25 @@ jobs:
5753
# initialized
5854
- run: sleep 10 && TEST_PROVIDER=geth yarn wsrun test contracts
5955
test-publish:
56+
resource_class: medium+
6057
docker:
6158
- image: circleci/node:9
62-
- image: verdaccio/verdaccio
59+
- image: 0xorg/verdaccio
6360
working_directory: ~/repo
6461
steps:
6562
- restore_cache:
6663
keys:
6764
- repo-{{ .Environment.CIRCLE_SHA1 }}
6865
- run: yarn test:publish:circleci
66+
test-doc-generation:
67+
docker:
68+
- image: circleci/node:9
69+
working_directory: ~/repo
70+
steps:
71+
- restore_cache:
72+
keys:
73+
- repo-{{ .Environment.CIRCLE_SHA1 }}
74+
- run: yarn test:generate_docs:circleci
6975
test-rest:
7076
docker:
7177
- image: circleci/node:9
@@ -74,7 +80,6 @@ jobs:
7480
- restore_cache:
7581
keys:
7682
- repo-{{ .Environment.CIRCLE_SHA1 }}
77-
- run: yarn wsrun test:circleci 0x.js
7883
- run: yarn wsrun test:circleci @0xproject/abi-gen
7984
- run: yarn wsrun test:circleci @0xproject/assert
8085
- run: yarn wsrun test:circleci @0xproject/base-contract
@@ -87,14 +92,11 @@ jobs:
8792
- run: yarn wsrun test:circleci @0xproject/order-watcher
8893
- run: yarn wsrun test:circleci @0xproject/sol-compiler
8994
- run: yarn wsrun test:circleci @0xproject/sol-cov
95+
- run: yarn wsrun test:circleci @0xproject/sol-doc
9096
- run: yarn wsrun test:circleci @0xproject/sra-report
9197
- run: yarn wsrun test:circleci @0xproject/subproviders
9298
- run: yarn wsrun test:circleci @0xproject/web3-wrapper
9399
- run: yarn wsrun test:circleci @0xproject/utils
94-
- save_cache:
95-
key: coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }}
96-
paths:
97-
- ~/repo/packages/0x.js/coverage/lcov.info
98100
- save_cache:
99101
key: coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
100102
paths:
@@ -143,6 +145,10 @@ jobs:
143145
key: coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
144146
paths:
145147
- ~/repo/packages/sol-cov/coverage/lcov.info
148+
- save_cache:
149+
key: coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
150+
paths:
151+
- ~/repo/packages/sol-doc/coverage/lcov.info
146152
- save_cache:
147153
key: coverage-sra-report-{{ .Environment.CIRCLE_SHA1 }}
148154
paths:
@@ -163,8 +169,10 @@ jobs:
163169
- restore_cache:
164170
keys:
165171
- repo-{{ .Environment.CIRCLE_SHA1 }}
166-
- run: yarn prettier:ci
167172
- run: yarn lerna run lint
173+
- run: yarn prettier:ci
174+
- run: cd packages/0x.js && yarn build:umd:prod
175+
- run: yarn bundlesize
168176
submit-coverage:
169177
docker:
170178
- image: circleci/node:9
@@ -173,9 +181,6 @@ jobs:
173181
- restore_cache:
174182
keys:
175183
- repo-{{ .Environment.CIRCLE_SHA1 }}
176-
- restore_cache:
177-
keys:
178-
- coverage-0xjs-{{ .Environment.CIRCLE_SHA1 }}
179184
- restore_cache:
180185
keys:
181186
- coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
@@ -212,6 +217,9 @@ jobs:
212217
- restore_cache:
213218
keys:
214219
- coverage-sol-cov-{{ .Environment.CIRCLE_SHA1 }}
220+
- restore_cache:
221+
keys:
222+
- coverage-sol-doc-{{ .Environment.CIRCLE_SHA1 }}
215223
- restore_cache:
216224
keys:
217225
- coverage-sra-report-{{ .Environment.CIRCLE_SHA1 }}
@@ -230,6 +238,9 @@ workflows:
230238
main:
231239
jobs:
232240
- build
241+
- build-website:
242+
requires:
243+
- build
233244
- test-contracts-ganache:
234245
requires:
235246
- build
@@ -245,6 +256,9 @@ workflows:
245256
- test-publish:
246257
requires:
247258
- build
259+
- test-doc-generation:
260+
requires:
261+
- build
248262
- submit-coverage:
249263
requires:
250264
- test-rest

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ packages/order-watcher/test/artifacts/
8484
packages/contract-wrappers/test/artifacts/
8585
packages/contract-wrappers/src/artifacts/
8686
packages/order-watcher/src/artifacts/
87+
packages/0x.js/src/artifacts/
88+
packages/order-utils/src/artifacts/
89+
90+
# unstable generated contract artifacts:
91+
packages/migrations/artifacts/development/
8792

8893
# generated contract watcher
8994
packages/0x.js/src/generated_contract_wrappers/
@@ -94,8 +99,9 @@ packages/fill-scenarios/src/generated_contract_wrappers/
9499
packages/order-watcher/src/generated_contract_wrappers/
95100
packages/order-utils/src/generated_contract_wrappers/
96101
packages/migrations/src/1.0.0/contract_wrappers
102+
packages/migrations/src/2.0.0-testnet/contract_wrappers
97103
packages/migrations/src/2.0.0/contract_wrappers
98-
packages/migrations/src/2.0.0-beta-testnet/contract_wrappers
104+
packages/migrations/src/development/contract_wrappers
99105

100106
# solc-bin in sol-compiler
101107
packages/sol-compiler/solc_bin/

.prettierignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ lib
88
/packages/order-watcher/src/generated_contract_wrappers/
99
/packages/order-utils/src/generated_contract_wrappers/
1010
/packages/migrations/src/1.0.0/contract_wrappers
11+
/packages/migrations/src/2.0.0-testnet/contract_wrappers
1112
/packages/migrations/src/2.0.0/contract_wrappers
12-
/packages/migrations/src/2.0.0-beta-testnet/contract_wrappers
1313
/packages/0x.js/src/artifacts
1414
/packages/contracts/src/artifacts
1515
/packages/contract-wrappers/src/artifacts
1616
/packages/order-watcher/src/artifacts
1717
/packages/metacoin/artifacts
18-
/packages/sra-api/public/
18+
/packages/sra-spec/public/
1919
/packages/contract-wrappers/test/artifacts
2020
/packages/order-watcher/test/artifacts
2121
/packages/migrations/artifacts/1.0.0
22+
/packages/migrations/artifacts/2.0.0-testnet
2223
/packages/migrations/artifacts/2.0.0
23-
/packages/migrations/artifacts/2.0.0-beta-testnet
24+
/packages/migrations/artifacts/development
2425
package.json
2526
scripts/postpublish_utils.js
27+
packages/sol-cov/test/fixtures/artifacts

CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See https://help.github.com/articles/about-codeowners/
2+
# for more info about CODEOWNERS file
3+
4+
# It uses the same pattern rule for gitignore file
5+
# https://git-scm.com/docs/gitignore#_pattern_format
6+
7+
# Website
8+
packages/website/ @BMillman19 @fragosti

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This repository is a monorepo including the 0x protocol smart contracts and nume
88

99
If you're developing on 0x now or are interested in using 0x infrastructure in the future, please join our [developer mailing list][dev-mailing-list-url] for updates.
1010

11-
[website-url]: https://0xproject.com/
11+
[website-url]: https://0xproject.com
1212
[whitepaper-url]: https://0xproject.com/pdfs/0x_white_paper.pdf
1313
[dev-mailing-list-url]: http://eepurl.com/dx4cPf
1414

@@ -25,16 +25,19 @@ If you're developing on 0x now or are interested in using 0x infrastructure in t
2525
| [`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 |
2626
| [`@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 |
2727
| [`@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 |
28+
| [`@0xproject/assert`](/packages/asset-buyer) | [![npm](https://img.shields.io/npm/v/@0xproject/asset-buyer.svg)](https://www.npmjs.com/package/@0xproject/asset-buyer) | Convenience package for discovering and buying assets with Ether. |
2829
| [`@0xproject/base-contract`](/packages/base-contract) | [![npm](https://img.shields.io/npm/v/@0xproject/base-contract.svg)](https://www.npmjs.com/package/@0xproject/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
2930
| [`@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 |
30-
| [`@0xproject/sol-compiler`](/packages/sol-compiler) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-compiler.svg)](https://www.npmjs.com/package/@0xproject/sol-compiler) | A thin wrapper around Solc.js that outputs artifacts, resolves imports, only re-compiles when needed, and other niceties. |
3131
| [`@0xproject/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0xproject/dev-utils.svg)](https://www.npmjs.com/package/@0xproject/dev-utils) | Dev utils to be shared across 0x projects and packages |
3232
| [`@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 |
3333
| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | [![npm](https://img.shields.io/npm/v/@0xproject/monorepo-scripts.svg)](https://www.npmjs.com/package/@0xproject/monorepo-scripts) | Monorepo scripts |
34+
| [`@0xproject/order-utils`](/packages/order-utils) | [![npm](https://img.shields.io/npm/v/@0xproject/order-utils.svg)](https://www.npmjs.com/package/@0xproject/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders. |
3435
| [`@0xproject/react-docs`](/packages/react-docs) | [![npm](https://img.shields.io/npm/v/@0xproject/react-docs.svg)](https://www.npmjs.com/package/@0xproject/react-docs) | React documentation component for rendering TypeDoc & Doxity generated JSON |
3536
| [`@0xproject/react-shared`](/packages/react-shared) | [![npm](https://img.shields.io/npm/v/@0xproject/react-shared.svg)](https://www.npmjs.com/package/@0xproject/react-shared) | 0x shared react components |
36-
| [`@0xproject/sra-report`](/packages/sra-report) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-report.svg)](https://www.npmjs.com/package/@0xproject/sra-report) | Generate reports for standard relayer API compliance |
37+
| [`@0xproject/sol-compiler`](/packages/sol-compiler) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-compiler.svg)](https://www.npmjs.com/package/@0xproject/sol-compiler) | A thin wrapper around Solc.js that outputs artifacts, resolves imports, only re-compiles when needed, and other niceties. |
3738
| [`@0xproject/sol-cov`](/packages/sol-cov) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-cov.svg)](https://www.npmjs.com/package/@0xproject/sol-cov) | Solidity test coverage tool |
39+
| [`@0xproject/sra-spec`](/packages/sra-spec) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-spec.svg)](https://www.npmjs.com/package/@0xproject/sra-spec) | OpenAPI specification for the standard relayer API |
40+
| [`@0xproject/sra-report`](/packages/sra-report) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-report.svg)](https://www.npmjs.com/package/@0xproject/sra-report) | Generate reports for standard relayer API compliance |
3841
| [`@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) |
3942
| [`@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 |
4043
| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations |
@@ -68,7 +71,7 @@ Dedicated documentation pages:
6871
Node version >= 6.12 is required.
6972

7073
Most of the packages require additional typings for external dependencies.
71-
You can include those by prepending @0xproject/typescript-typings package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
74+
You can include those by prepending the `@0xproject/typescript-typings` package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config.
7275

7376
```json
7477
"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
@@ -82,13 +85,7 @@ We strongly recommend that the community help us make improvements and determine
8285

8386
### Install dependencies
8487

85-
Make sure you are using Yarn v1.6. To install using brew:
86-
87-
```
88-
brew unlink yarn
89-
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/76215230de5f7f7bee2cfcdd7185cf49d949862d/Formula/yarn.rb
90-
brew switch yarn 1.6.0_1
91-
```
88+
Make sure you are using Yarn v1.9.4. To install using brew:
9289

9390
Then install dependencies
9491

0 commit comments

Comments
 (0)