aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-12-06 00:53:59 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-12-06 00:53:59 +0800
commit1ce66b4a81b736f5288463be609a902af64cbe77 (patch)
tree55a563c7d7a53213c3299f333e80e916c17e265b
parent63b1199bd545b9f37481fdb8707c0acc49c4d4c3 (diff)
downloaddexon-sol-tools-1ce66b4a81b736f5288463be609a902af64cbe77.tar
dexon-sol-tools-1ce66b4a81b736f5288463be609a902af64cbe77.tar.gz
dexon-sol-tools-1ce66b4a81b736f5288463be609a902af64cbe77.tar.bz2
dexon-sol-tools-1ce66b4a81b736f5288463be609a902af64cbe77.tar.lz
dexon-sol-tools-1ce66b4a81b736f5288463be609a902af64cbe77.tar.xz
dexon-sol-tools-1ce66b4a81b736f5288463be609a902af64cbe77.tar.zst
dexon-sol-tools-1ce66b4a81b736f5288463be609a902af64cbe77.zip
Rename abi-gen to typed-contracts
-rw-r--r--packages/0x.js/package.json6
-rw-r--r--packages/0x.js/src/contract_wrappers/generated/ether_token.ts4
-rw-r--r--packages/0x.js/src/contract_wrappers/generated/exchange.ts4
-rw-r--r--packages/0x.js/src/contract_wrappers/generated/token.ts4
-rw-r--r--packages/0x.js/src/contract_wrappers/generated/token_registry.ts4
-rw-r--r--packages/0x.js/src/contract_wrappers/generated/token_transfer_proxy.ts4
-rw-r--r--packages/abi-gen-templates/contract.mustache (renamed from packages/typed-contracts-templates/contract.mustache)4
-rw-r--r--packages/abi-gen-templates/package.json (renamed from packages/typed-contracts-templates/package.json)4
-rw-r--r--packages/abi-gen-templates/partials/call.mustache (renamed from packages/typed-contracts-templates/partials/call.mustache)0
-rw-r--r--packages/abi-gen-templates/partials/params.mustache (renamed from packages/typed-contracts-templates/partials/params.mustache)0
-rw-r--r--packages/abi-gen-templates/partials/return_type.mustache (renamed from packages/typed-contracts-templates/partials/return_type.mustache)0
-rw-r--r--packages/abi-gen-templates/partials/tx.mustache (renamed from packages/typed-contracts-templates/partials/tx.mustache)0
-rw-r--r--packages/abi-gen-templates/partials/typed_params.mustache (renamed from packages/typed-contracts-templates/partials/typed_params.mustache)0
-rw-r--r--packages/abi-gen/README.md (renamed from packages/typed-contracts/README.md)10
-rw-r--r--packages/abi-gen/package.json (renamed from packages/typed-contracts/package.json)8
-rw-r--r--packages/abi-gen/src/globals.d.ts (renamed from packages/typed-contracts/src/globals.d.ts)0
-rw-r--r--packages/abi-gen/src/index.ts (renamed from packages/typed-contracts/src/index.ts)0
-rw-r--r--packages/abi-gen/src/types.ts (renamed from packages/typed-contracts/src/types.ts)0
-rw-r--r--packages/abi-gen/src/utils.ts (renamed from packages/typed-contracts/src/utils.ts)0
-rw-r--r--packages/abi-gen/tsconfig.json (renamed from packages/typed-contracts/tsconfig.json)0
-rw-r--r--packages/abi-gen/tslint.json (renamed from packages/typed-contracts/tslint.json)0
21 files changed, 26 insertions, 26 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index b91f23ecb..b09aadd7e 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -16,7 +16,7 @@
"build": "run-p build:umd:prod build:commonjs; exit 0;",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR",
"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",
- "generate_contract_wrappers": "typed-contracts --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json' --templates ../typed-contracts-templates/ --output src/contract_wrappers/generated",
+ "generate_contract_wrappers": "abi-gen --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json' --templates ../abi-gen-templates/ --output src/contract_wrappers/generated",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
"test:circleci": "run-s test:coverage report_test_coverage && if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi",
"test": "run-s clean test:commonjs",
@@ -46,8 +46,8 @@
},
"devDependencies": {
"@0xproject/tslint-config": "^0.2.0",
- "@0xproject/typed-contracts": "^0.0.0",
- "@0xproject/typed-contracts-templates": "^0.0.0",
+ "abi-gen": "^0.0.0",
+ "abi-gen-templates": "^0.0.0",
"@types/bintrees": "^1.0.2",
"@types/jsonschema": "^1.1.1",
"@types/lodash": "^4.14.64",
diff --git a/packages/0x.js/src/contract_wrappers/generated/ether_token.ts b/packages/0x.js/src/contract_wrappers/generated/ether_token.ts
index aae6230c9..1e4230788 100644
--- a/packages/0x.js/src/contract_wrappers/generated/ether_token.ts
+++ b/packages/0x.js/src/contract_wrappers/generated/ether_token.ts
@@ -1,6 +1,6 @@
/**
- * This file is auto-generated using @0xproject/typed-contracts. Don't edit directly.
- * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts-templates.
+ * This file is auto-generated using @0xproject/abi-gen. Don't edit directly.
+ * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
*/
import {BigNumber} from 'bignumber.js';
import * as Web3 from 'web3';
diff --git a/packages/0x.js/src/contract_wrappers/generated/exchange.ts b/packages/0x.js/src/contract_wrappers/generated/exchange.ts
index 512cc80d7..e6bc74c65 100644
--- a/packages/0x.js/src/contract_wrappers/generated/exchange.ts
+++ b/packages/0x.js/src/contract_wrappers/generated/exchange.ts
@@ -1,6 +1,6 @@
/**
- * This file is auto-generated using @0xproject/typed-contracts. Don't edit directly.
- * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts-templates.
+ * This file is auto-generated using @0xproject/abi-gen. Don't edit directly.
+ * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
*/
import {BigNumber} from 'bignumber.js';
import * as Web3 from 'web3';
diff --git a/packages/0x.js/src/contract_wrappers/generated/token.ts b/packages/0x.js/src/contract_wrappers/generated/token.ts
index f8f578dd9..7762a29e5 100644
--- a/packages/0x.js/src/contract_wrappers/generated/token.ts
+++ b/packages/0x.js/src/contract_wrappers/generated/token.ts
@@ -1,6 +1,6 @@
/**
- * This file is auto-generated using @0xproject/typed-contracts. Don't edit directly.
- * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts-templates.
+ * This file is auto-generated using @0xproject/abi-gen. Don't edit directly.
+ * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
*/
import {BigNumber} from 'bignumber.js';
import * as Web3 from 'web3';
diff --git a/packages/0x.js/src/contract_wrappers/generated/token_registry.ts b/packages/0x.js/src/contract_wrappers/generated/token_registry.ts
index 5638a92d6..ce03449d8 100644
--- a/packages/0x.js/src/contract_wrappers/generated/token_registry.ts
+++ b/packages/0x.js/src/contract_wrappers/generated/token_registry.ts
@@ -1,6 +1,6 @@
/**
- * This file is auto-generated using @0xproject/typed-contracts. Don't edit directly.
- * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts-templates.
+ * This file is auto-generated using @0xproject/abi-gen. Don't edit directly.
+ * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
*/
import {BigNumber} from 'bignumber.js';
import * as Web3 from 'web3';
diff --git a/packages/0x.js/src/contract_wrappers/generated/token_transfer_proxy.ts b/packages/0x.js/src/contract_wrappers/generated/token_transfer_proxy.ts
index 33e244d8d..41c9669e3 100644
--- a/packages/0x.js/src/contract_wrappers/generated/token_transfer_proxy.ts
+++ b/packages/0x.js/src/contract_wrappers/generated/token_transfer_proxy.ts
@@ -1,6 +1,6 @@
/**
- * This file is auto-generated using @0xproject/typed-contracts. Don't edit directly.
- * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts-templates.
+ * This file is auto-generated using @0xproject/abi-gen. Don't edit directly.
+ * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
*/
import {BigNumber} from 'bignumber.js';
import * as Web3 from 'web3';
diff --git a/packages/typed-contracts-templates/contract.mustache b/packages/abi-gen-templates/contract.mustache
index cb3bb3631..27783fb6e 100644
--- a/packages/typed-contracts-templates/contract.mustache
+++ b/packages/abi-gen-templates/contract.mustache
@@ -1,6 +1,6 @@
/**
- * This file is auto-generated using @0xproject/typed-contracts. Don't edit directly.
- * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts-templates.
+ * This file is auto-generated using abi-gen. Don't edit directly.
+ * Templates can be found at https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates.
*/
import {BigNumber} from 'bignumber.js';
import * as Web3 from 'web3';
diff --git a/packages/typed-contracts-templates/package.json b/packages/abi-gen-templates/package.json
index e690e93a1..622c35478 100644
--- a/packages/typed-contracts-templates/package.json
+++ b/packages/abi-gen-templates/package.json
@@ -1,5 +1,5 @@
{
- "name": "@0xproject/typed-contracts-templates",
+ "name": "@0xproject/abi-gen-templates",
"version": "0.0.0",
"description": "Handlebars templates to generate TS contract wrappers",
"repository": {
@@ -10,5 +10,5 @@
"bugs": {
"url": "https://github.com/0xProject/0x.js/issues"
},
- "homepage": "https://github.com/0xProject/0x.js/packages/typed-contracts-templates/README.md"
+ "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen-templates/README.md"
}
diff --git a/packages/typed-contracts-templates/partials/call.mustache b/packages/abi-gen-templates/partials/call.mustache
index ef4bda724..ef4bda724 100644
--- a/packages/typed-contracts-templates/partials/call.mustache
+++ b/packages/abi-gen-templates/partials/call.mustache
diff --git a/packages/typed-contracts-templates/partials/params.mustache b/packages/abi-gen-templates/partials/params.mustache
index ac5d4ae85..ac5d4ae85 100644
--- a/packages/typed-contracts-templates/partials/params.mustache
+++ b/packages/abi-gen-templates/partials/params.mustache
diff --git a/packages/typed-contracts-templates/partials/return_type.mustache b/packages/abi-gen-templates/partials/return_type.mustache
index 383961a40..383961a40 100644
--- a/packages/typed-contracts-templates/partials/return_type.mustache
+++ b/packages/abi-gen-templates/partials/return_type.mustache
diff --git a/packages/typed-contracts-templates/partials/tx.mustache b/packages/abi-gen-templates/partials/tx.mustache
index 8a43e5319..8a43e5319 100644
--- a/packages/typed-contracts-templates/partials/tx.mustache
+++ b/packages/abi-gen-templates/partials/tx.mustache
diff --git a/packages/typed-contracts-templates/partials/typed_params.mustache b/packages/abi-gen-templates/partials/typed_params.mustache
index 3ea4b2e95..3ea4b2e95 100644
--- a/packages/typed-contracts-templates/partials/typed_params.mustache
+++ b/packages/abi-gen-templates/partials/typed_params.mustache
diff --git a/packages/typed-contracts/README.md b/packages/abi-gen/README.md
index 5649af0dd..77dcae2ad 100644
--- a/packages/typed-contracts/README.md
+++ b/packages/abi-gen/README.md
@@ -4,13 +4,13 @@ This package allows you to generate TS contract wrappers from ABI files.
You can write your custom handlebars templates which will allow you to seamlessly integrate the generated code into your existing codebase with existing conventions.
For the example of the generated [wrapper files](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/src/contract_wrappers/generated) check out 0x.js.
-[Here](https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts-templates) are the templates used to generate those files.
+[Here](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates) are the templates used to generate those files.
## Instalation
-`yarn add -g @0xproject/typed-contracts`
+`yarn add -g @0xproject/abi-gen`
## Usage
```
-typed-contracts
+abi-gen
Options:
--help Show help [boolean]
--version Show version number [boolean]
@@ -28,11 +28,11 @@ We could've just used `--abiGlob 'src/artifacts/*.json` but we wanted to exclude
The abi file should be either a truffle contract artifact (a JSON object with the abi key) or a JSON abi array.
## How to write custom templates?
-The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts-templates) and start playing with them adjusting them for your needs.
+The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen-templates) and start playing with them adjusting them for your needs.
We use [handlebars](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 partials folder - they will be registered and available.
## Which data/context do I get in my templates?
For now you don't get much on top of methods abi and a contract name cause if was enough for our use-case, but if you need something else - create a PR.
-[Type definition](https://github.com/0xProject/0x.js/tree/development/packages/typed-contracts/src/types.ts) of what we pass to a render method.
+[Type definition](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen/src/types.ts) of what we pass to a render method.
## Output files
Output files will be generated within an output folder with names converted to camel case and taken from abi files names. If you already have some files in that folder they will be overwritten.
diff --git a/packages/typed-contracts/package.json b/packages/abi-gen/package.json
index 6d8aa5016..01bede249 100644
--- a/packages/typed-contracts/package.json
+++ b/packages/abi-gen/package.json
@@ -1,7 +1,7 @@
{
- "name": "@0xproject/typed-contracts",
+ "name": "abi-gen",
"version": "0.0.0",
- "description": "Generate TS contract wrappers from ABI",
+ "description": "Generate contract wrappers from ABI and handlebars templates",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
@@ -10,7 +10,7 @@
"build": "tsc"
},
"bin": {
- "typed-contracts": "lib/index.js"
+ "abi-gen": "lib/index.js"
},
"repository": {
"type": "git",
@@ -20,7 +20,7 @@
"bugs": {
"url": "https://github.com/0xProject/0x.js/issues"
},
- "homepage": "https://github.com/0xProject/0x.js/packages/typed-contracts/README.md",
+ "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md",
"dependencies": {
"@types/handlebars": "^4.0.36",
"bignumber.js": "^5.0.0",
diff --git a/packages/typed-contracts/src/globals.d.ts b/packages/abi-gen/src/globals.d.ts
index 39df3f852..39df3f852 100644
--- a/packages/typed-contracts/src/globals.d.ts
+++ b/packages/abi-gen/src/globals.d.ts
diff --git a/packages/typed-contracts/src/index.ts b/packages/abi-gen/src/index.ts
index 19d289e49..19d289e49 100644
--- a/packages/typed-contracts/src/index.ts
+++ b/packages/abi-gen/src/index.ts
diff --git a/packages/typed-contracts/src/types.ts b/packages/abi-gen/src/types.ts
index 1dc039c83..1dc039c83 100644
--- a/packages/typed-contracts/src/types.ts
+++ b/packages/abi-gen/src/types.ts
diff --git a/packages/typed-contracts/src/utils.ts b/packages/abi-gen/src/utils.ts
index eaf5a30cc..eaf5a30cc 100644
--- a/packages/typed-contracts/src/utils.ts
+++ b/packages/abi-gen/src/utils.ts
diff --git a/packages/typed-contracts/tsconfig.json b/packages/abi-gen/tsconfig.json
index 2a3667890..2a3667890 100644
--- a/packages/typed-contracts/tsconfig.json
+++ b/packages/abi-gen/tsconfig.json
diff --git a/packages/typed-contracts/tslint.json b/packages/abi-gen/tslint.json
index a07795151..a07795151 100644
--- a/packages/typed-contracts/tslint.json
+++ b/packages/abi-gen/tslint.json