This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 465
Reorganize and modularize generated contract wrappers and artifacts #1105
Merged
Merged
Changes from 45 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
81c4887
Move generated contract wrappers and artifacts into contracts package
albrow 026ad1f
Update contract-wrappers package to use new contracts package for gen…
albrow 90f5e4d
Update .prettierignore
albrow 5b1b423
Change @0xproject/contracts version number back to 2.1.48
albrow 33335a6
Automatically collapse contract artifacts by adding them to .gitattri…
albrow 2aa73fc
Add generated contract wrappers in contracts package to gitignore
albrow 3a7bb97
Remove artifacts from migrations package and update contract-wrappers…
albrow 1da3604
Create contract-artifacts package (needed to solve dependency cycle)
albrow 8f0ceaf
Create abi-gen-wrappers package
albrow 2bd7b0f
update contract_wrappers to use new artifacts and abi-gen wrappers pa…
albrow 57d9fcf
update order-utils to use new artifacts and abi-gen wrappers packages
albrow d0b37fc
update fill-scenarios to use new artifacts and abi-gen wrappers packages
albrow 3da032f
update asset-buyer to use new artifacts and abi-gen wrappers packages
albrow 29063ca
update order-watcher to use new artifacts and abi-gen wrappers packages
albrow 255da32
Update testnet-faucets and website to work with new artifacts and abi…
albrow 3af7d1a
Add missing dependency to abi-gen-wrappers
albrow 1411210
Remove generated artifacts in the contracts package
albrow 17c6661
Cleanup migrations and contracts package. Make contracts private again.
albrow ecdd6e3
Fix linter errors in contract-wrappers
albrow a48e0a0
Add new runMigrationsOnce method to migrations. Update contract-wrapp…
albrow 6c8fb37
Update order-watcher to use new migrations functions
albrow 1b8b2c0
Appease linter
albrow 770cf52
Remove unused copyfiles dependencies
albrow 33e65c3
Remove unused abi-gen dependencies
albrow fa346d9
Remove networks/addresses from contract-artifacts package
albrow 1e9ea09
Introduce new contract-addresses package and use it everywhere
albrow 6d79e30
Update .gitattributes
albrow 0e1cd97
Use contractAddresses directly in revert_validation_test.ts
albrow 68f150e
Remove as any hack from artifacts in contracts package
albrow 974ec23
Apply various PR feedback
albrow c83dec2
Improve error handling for unknown network ids in contract-wrappers
albrow d76d8ab
Update .gitignore and .prettierignore
albrow 8dc73d3
Add README.md for each new package
albrow 7a6cace
Create CHANGELOG.json for three new packages
albrow 24673be
Add resolveJsonModule: true to test_installation.ts
albrow 003ab1e
Fix linter errors in contract-wrappers
albrow f0e4837
Fix failing doc generation tests
albrow 00db096
Fix bug introduced during rebase
albrow be1a597
Remove ContractAddresses from packages/types (mistake after rebase)
albrow e3af06a
Update CHANGELOG.json for all changed packages
albrow 38b146c
Add OrThrow suffix to getContractAddressesForNetwork
albrow e093864
Update json-schemas for contract-wrappers
albrow 6f8e98e
In contract-wrappers, remove setProvider and add unsubscribeAll method.
albrow 2c63909
In abi-gen-wrappers, ./wrappers -> ./src/generated-wrappers
albrow 5509bf5
Update website to use the new unsubscribeAll method in contract-wrappers
albrow 3c5812c
Update prettierignore
albrow 5bdfad9
Remove ContractNotFound errors in contract-wrappers
albrow 8cffe65
fix(monorepo-scripts): Move the creation of the `.installation-test` …
fabioberger 2e56e2c
fix(0x.js): make web3-provider-engine types a 'dependency' so it's av…
fabioberger eab88cb
fix(dev-utils): make web3-provider-engine types a 'dependency' so it'…
fabioberger 75b0781
fix(sol-cov): make @types/solidity-parser-antlr a 'dependency' so it'…
fabioberger 6c92778
fix(sra-spec): make @loopback/openapi-v3-types a 'dependency' so it's…
fabioberger 0210411
fix(subproviders): make web3-provider-engine types a 'dependency' so …
fabioberger fca5260
Add changelog entries
fabioberger 5938e8a
fix(dev-utils): Make chai a dev dependency since exported interface d…
fabioberger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
*.sol linguist-language=Solidity | ||
|
||
# Automatically collapse generated files in GitHub. | ||
packages/contract-artifacts/artifacts/*json linguist-generated | ||
packages/abi-gen-wrappers/wrappers/*.ts liguist-generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,12 @@ | ||
lib | ||
.nyc_output | ||
/packages/contract-wrappers/src/contract_wrappers/generated/ | ||
/packages/contracts/generated-wrappers | ||
/packages/contracts/generated-artifacts | ||
/packages/abi-gen-wrappers/wrappers | ||
/packages/contract-artifacts/artifacts | ||
/packages/metacoin/src/contract_wrappers | ||
/packages/0x.js/src/generated_contract_wrappers/ | ||
/packages/contracts/generated_contract_wrappers/ | ||
/packages/fill-scenarios/src/generated_contract_wrappers/ | ||
/packages/order-watcher/src/generated_contract_wrappers/ | ||
/packages/order-utils/src/generated_contract_wrappers/ | ||
/packages/migrations/src/1.0.0/contract_wrappers | ||
/packages/migrations/src/2.0.0-testnet/contract_wrappers | ||
/packages/migrations/src/2.0.0/contract_wrappers | ||
/packages/0x.js/src/artifacts | ||
/packages/contracts/src/artifacts | ||
/packages/contract-wrappers/src/artifacts | ||
/packages/order-watcher/src/artifacts | ||
/packages/metacoin/artifacts | ||
/packages/sra-spec/public/ | ||
/packages/contract-wrappers/test/artifacts | ||
/packages/order-watcher/test/artifacts | ||
/packages/migrations/artifacts/1.0.0 | ||
/packages/migrations/artifacts/2.0.0-testnet | ||
/packages/migrations/artifacts/2.0.0 | ||
/packages/migrations/artifacts/development | ||
package.json | ||
scripts/postpublish_utils.js | ||
packages/sol-cov/test/fixtures/artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
"report_coverage": "lcov-result-merger './{packages/*/coverage/lcov.info,python-packages/*/.coverage}' | coveralls", | ||
"test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js", | ||
"test:installation:local": "IS_LOCAL_PUBLISH=true node ./packages/monorepo-scripts/lib/test_installation.js", | ||
"test:publish:circleci:comment": "HACK(albrow) We need an automated way to login to npm and echo+sleep piped to stdin was the only way I could find to do it.", | ||
"test:publish:circleci": "yarn npm-cli-login -u test -p test -e [email protected] -r http://localhost:4873 && IS_LOCAL_PUBLISH=true run-s script:publish test:installation:local", | ||
"run:publish": "run-s install:all build:monorepo_scripts script:prepublish_checks rebuild:no_website script:publish", | ||
"run:publish:local": "IS_LOCAL_PUBLISH=true yarn run:publish", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
"compilerOptions": { | ||
"outDir": "lib" | ||
}, | ||
"include": ["./src/**/*", "./test/**/*"] | ||
"include": ["./src/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"version": "1.0.0", | ||
"changes": [ | ||
{ | ||
"pr": 1105, | ||
"note": "Initial release" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
## @0xproject/abi-gen-wrappers | ||
|
||
Low-level 0x smart contract wrappers generated using @0xproject/abi-gen. These | ||
low-level wrappers are imported by other packages in the 0x monorepo and | ||
application developers are not expected to import this package directly. | ||
|
||
You may also be interested in the | ||
[@0xproject/contract-wrappers](../contract-wrappers/README.md) package which | ||
includes some higher-level features. | ||
|
||
## Installation | ||
|
||
```bash | ||
yarn add @0xproject/abi-gen-wrappers | ||
``` | ||
|
||
**Import** | ||
|
||
```typescript | ||
import * as wrappers from '@0xproject/abi-gen-wrappers'; | ||
``` | ||
|
||
or | ||
|
||
```javascript | ||
var wrappers = require('@0xproject/abi-gen-wrappers'); | ||
``` | ||
|
||
## 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/abi-gen-wrappers yarn build | ||
``` | ||
|
||
### Clean | ||
|
||
```bash | ||
yarn clean | ||
``` | ||
|
||
### Lint | ||
|
||
```bash | ||
yarn lint | ||
``` | ||
|
||
### Run Tests | ||
|
||
```bash | ||
yarn test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "@0xproject/abi-gen-wrappers", | ||
"version": "1.0.0", | ||
"engines": { | ||
"node": ">=6.12" | ||
}, | ||
"description": "Low-level 0x smart contract wrappers generated using @0xproject/abi-gen", | ||
"main": "lib/src/index.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"build": "yarn pre_build && tsc -b", | ||
"build:ci": "yarn build", | ||
"pre_build": "yarn generate_contract_wrappers", | ||
"clean": "shx rm -rf lib wrappers", | ||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers" | ||
}, | ||
"config": { | ||
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IValidator|IWallet|OrderValidator|WETH9|ZRXToken).json" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/0xProject/0x-monorepo.git" | ||
}, | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/0xProject/0x-monorepo/issues" | ||
}, | ||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md", | ||
"devDependencies": { | ||
"@0xproject/abi-gen": "^1.0.12", | ||
"shx": "^0.2.2" | ||
}, | ||
"dependencies": { | ||
"@0xproject/base-contract": "^3.0.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️