Rename contract_templates to abi-gen-templates
This commit is contained in:
parent
8fda11ec3a
commit
5d70fe053d
@ -14,7 +14,7 @@ packages/website/ @BMillman19 @fragosti @fabioberger @steveklebanoff
|
|||||||
packages/abi-gen/ @LogvinovLeon
|
packages/abi-gen/ @LogvinovLeon
|
||||||
packages/base-contract/ @LogvinovLeon
|
packages/base-contract/ @LogvinovLeon
|
||||||
packages/connect/ @fragosti
|
packages/connect/ @fragosti
|
||||||
packages/contract_templates/ @LogvinovLeon
|
packages/abi-gen-templates/ @LogvinovLeon
|
||||||
packages/contract-addresses/ @albrow
|
packages/contract-addresses/ @albrow
|
||||||
packages/contract-artifacts/ @albrow
|
packages/contract-artifacts/ @albrow
|
||||||
packages/dev-utils/ @LogvinovLeon @fabioberger
|
packages/dev-utils/ @LogvinovLeon @fabioberger
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe 'lib/test/**/*.js' --timeout 100000 --bail --exit",
|
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe 'lib/test/**/*.js' --timeout 100000 --bail --exit",
|
||||||
"compile": "sol-compiler --contracts-dir contracts",
|
"compile": "sol-compiler --contracts-dir contracts",
|
||||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../packages/contract_templates/contract.handlebars --partials '../../packages/contract_templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../packages/abi-gen-templates/contract.handlebars --partials '../../packages/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||||
"coverage:report:text": "istanbul report text",
|
"coverage:report:text": "istanbul report text",
|
||||||
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
||||||
|
@ -4,7 +4,7 @@ webpack.config.js
|
|||||||
yarn-error.log
|
yarn-error.log
|
||||||
test/
|
test/
|
||||||
/src/
|
/src/
|
||||||
/contract_templates/
|
/abi-gen-templates/
|
||||||
/generated_docs/
|
/generated_docs/
|
||||||
/scripts/
|
/scripts/
|
||||||
/lib/src/monorepo_scripts/
|
/lib/src/monorepo_scripts/
|
||||||
|
@ -4,7 +4,7 @@ This package allows you to generate TypeScript contract wrappers from ABI files.
|
|||||||
It's heavily inspired by [Geth abigen](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) but takes a different approach.
|
It's heavily inspired by [Geth abigen](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) but takes a different approach.
|
||||||
You can write your custom handlebars templates which will allow you to seamlessly integrate the generated code into your existing codebase with existing conventions.
|
You can write your custom handlebars templates which will allow you to seamlessly integrate the generated code into your existing codebase with existing conventions.
|
||||||
|
|
||||||
[Here](https://github.com/0xProject/0x-monorepo/tree/development/packages/0x.js/contract_templates) are the templates used to generate the contract wrappers used by 0x.js.e
|
[Here](https://github.com/0xProject/0x-monorepo/tree/development/packages/0x.js/abi-gen-templates) are the templates used to generate the contract wrappers used by 0x.js.e
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ You need to also specify the location of your main template used for every contr
|
|||||||
|
|
||||||
## How to write custom templates?
|
## How to write custom templates?
|
||||||
|
|
||||||
The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x-monorepo/tree/development/packages/contract_templates) and start adjusting them for your needs.
|
The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x-monorepo/tree/development/packages/abi-gen-templates) and start adjusting them for your needs.
|
||||||
We use [handlebars](http://handlebarsjs.com/) template engine under the hood.
|
We use [handlebars](http://handlebarsjs.com/) template engine under the hood.
|
||||||
You need to have a master template called `contract.mustache`. it will be used to generate each contract wrapper. Although - you don't need and probably shouldn't write all your logic in a single template file. You can write [partial templates](http://handlebarsjs.com/partials.html) and as long as they are within a partials folder - they will be registered and available.
|
You need to have a master template called `contract.mustache`. it will be used to generate each contract wrapper. Although - you don't need and probably shouldn't write all your logic in a single template file. You can write [partial templates](http://handlebarsjs.com/partials.html) and as long as they are within a partials folder - they will be registered and available.
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ yarn-error.log
|
|||||||
test/
|
test/
|
||||||
/src/
|
/src/
|
||||||
/_bundles/
|
/_bundles/
|
||||||
/contract_templates/
|
/abi-gen-templates/
|
||||||
/generated_docs/
|
/generated_docs/
|
||||||
/scripts/
|
/scripts/
|
||||||
/lib/src/monorepo_scripts/
|
/lib/src/monorepo_scripts/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user