aboutsummaryrefslogtreecommitdiffstats
path: root/packages/abi-gen
diff options
context:
space:
mode:
Diffstat (limited to 'packages/abi-gen')
-rw-r--r--packages/abi-gen/CHANGELOG.json27
-rw-r--r--packages/abi-gen/CHANGELOG.md20
-rw-r--r--packages/abi-gen/README.md18
-rwxr-xr-xpackages/abi-gen/bin/abi-gen.js2
-rw-r--r--packages/abi-gen/package.json21
-rw-r--r--packages/abi-gen/src/index.ts9
6 files changed, 62 insertions, 35 deletions
diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json
index 55c03bf69..4b23b8118 100644
--- a/packages/abi-gen/CHANGELOG.json
+++ b/packages/abi-gen/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "0.3.0",
+ "changes": [
+ {
+ "note": "Properly export the executable binary",
+ "pr": 588
+ }
+ ]
+ },
+ {
+ "timestamp": 1525477860,
+ "version": "0.2.13",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1525428773,
+ "version": "0.2.12",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1524044013,
"version": "0.2.11",
"changes": [
diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md
index 6cad7a745..803414e14 100644
--- a/packages/abi-gen/CHANGELOG.md
+++ b/packages/abi-gen/CHANGELOG.md
@@ -5,11 +5,19 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v0.2.13 - _May 5, 2018_
+
+ * Dependencies updated
+
+## v0.2.12 - _May 4, 2018_
+
+ * Dependencies updated
+
## v0.2.11 - _April 18, 2018_
* Dependencies updated
-## v0.2.10 - _April 12, 2018_
+## v0.2.10 - _April 11, 2018_
* Dependencies updated
@@ -21,26 +29,26 @@ CHANGELOG
* Dependencies updated
-## v0.2.5 - _March 18, 2018_
+## v0.2.5 - _March 17, 2018_
* Consolidate all `console.log` calls into `logUtils` in the `@0xproject/utils` package (#452)
-## v0.2.4 - _March 4, 2018_
+## v0.2.4 - _March 3, 2018_
* Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3` (#413)
* Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types) (#413)
* Add `hasReturnValue` to context data (#413)
-## v0.2.1 - _February 9, 2018_
+## v0.2.1 - _February 8, 2018_
* Fix publishing issue where .npmignore was not properly excluding undesired content (#389)
-## v0.2.0 - _February 7, 2018_
+## v0.2.0 - _February 6, 2018_
* Added CLI options for explicit specifying location of partials and main template (#346)
* Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts (#388)
-## v0.1.0 - _January 11, 2018_
+## v0.1.0 - _January 10, 2018_
* Fixed array typings with union types (#295)
* Add event ABIs to context data passed to templates (#302)
diff --git a/packages/abi-gen/README.md b/packages/abi-gen/README.md
index 301bd709f..4240ba7ba 100644
--- a/packages/abi-gen/README.md
+++ b/packages/abi-gen/README.md
@@ -80,28 +80,16 @@ yarn install
### Build
-If this is your **first** time building this package, you must first build **all** packages within the monorepo. This is because packages that depend on other packages located inside this monorepo are symlinked when run from **within** the monorepo. This allows you to make changes across multiple packages without first publishing dependent packages to NPM. To build all packages, run the following from the monorepo root directory:
+To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:
```bash
-yarn lerna:rebuild
+PKG=@0xproject/abi-gen yarn build
```
Or continuously rebuild on change:
```bash
-yarn dev
-```
-
-You can also build this specific package by running the following from within its directory:
-
-```bash
-yarn build
-```
-
-or continuously rebuild on change:
-
-```bash
-yarn build:watch
+PKG=@0xproject/abi-gen yarn watch
```
### Clean
diff --git a/packages/abi-gen/bin/abi-gen.js b/packages/abi-gen/bin/abi-gen.js
new file mode 100755
index 000000000..c46eb9b66
--- /dev/null
+++ b/packages/abi-gen/bin/abi-gen.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('../lib/index.js')
diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json
index f8e1eb112..d0cd946f0 100644
--- a/packages/abi-gen/package.json
+++ b/packages/abi-gen/package.json
@@ -1,18 +1,21 @@
{
"name": "@0xproject/abi-gen",
- "version": "0.2.11",
+ "version": "0.2.13",
+ "engines": {
+ "node" : ">=6.12"
+ },
"description": "Generate contract wrappers from ABI and handlebars templates",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
- "build:watch": "tsc -w",
- "lint": "tslint --project . 'src/**/*.ts'",
+ "watch": "tsc -w",
+ "lint": "tslint --project .",
"clean": "shx rm -rf lib scripts",
"build": "tsc && copyfiles -u 2 './lib/monorepo_scripts/**/*' ./scripts",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js"
},
"bin": {
- "abi-gen": "lib/index.js"
+ "abi-gen": "bin/abi-gen.js"
},
"repository": {
"type": "git",
@@ -24,9 +27,9 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
"dependencies": {
- "@0xproject/types": "^0.6.1",
- "@0xproject/typescript-typings": "^0.2.0",
- "@0xproject/utils": "^0.5.2",
+ "@0xproject/types": "^0.6.3",
+ "@0xproject/typescript-typings": "^0.3.1",
+ "@0xproject/utils": "^0.6.1",
"chalk": "^2.3.0",
"glob": "^7.1.2",
"handlebars": "^4.0.11",
@@ -36,8 +39,8 @@
"yargs": "^10.0.3"
},
"devDependencies": {
- "@0xproject/monorepo-scripts": "^0.1.18",
- "@0xproject/tslint-config": "^0.4.16",
+ "@0xproject/monorepo-scripts": "^0.1.19",
+ "@0xproject/tslint-config": "^0.4.17",
"@types/glob": "^5.0.33",
"@types/handlebars": "^4.0.36",
"@types/mkdirp": "^0.5.1",
diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts
index ecef33b16..ef5710f53 100644
--- a/packages/abi-gen/src/index.ts
+++ b/packages/abi-gen/src/index.ts
@@ -61,14 +61,13 @@ const args = yargs
'Full usage example',
).argv;
-function registerPartials(partialsGlob: string) {
+function registerPartials(partialsGlob: string): void {
const partialTemplateFileNames = globSync(partialsGlob);
logUtils.log(`Found ${chalk.green(`${partialTemplateFileNames.length}`)} ${chalk.bold('partial')} templates`);
for (const partialTemplateFileName of partialTemplateFileNames) {
const namedContent = utils.getNamedContent(partialTemplateFileName);
Handlebars.registerPartial(namedContent.name, namedContent.content);
}
- return partialsGlob;
}
function writeOutputFile(name: string, renderedTsCode: string): void {
@@ -108,13 +107,13 @@ for (const abiFileName of abiFileNames) {
ABI = parsedContent; // ABI file
} else if (!_.isUndefined(parsedContent.abi)) {
ABI = parsedContent.abi; // Truffle artifact
- } else if (!_.isUndefined(parsedContent.networks) && !_.isUndefined(parsedContent.networks[args.networkId])) {
- ABI = parsedContent.networks[args.networkId].abi; // 0x contracts package artifact
+ } else if (!_.isUndefined(parsedContent.compilerOutput.abi)) {
+ ABI = parsedContent.compilerOutput.abi; // 0x artifact
}
if (_.isUndefined(ABI)) {
logUtils.log(`${chalk.red(`ABI not found in ${abiFileName}.`)}`);
logUtils.log(
- `Please make sure your ABI file is either an array with ABI entries or a truffle artifact or 0x deployer artifact`,
+ `Please make sure your ABI file is either an array with ABI entries or a truffle artifact or 0x sol-compiler artifact`,
);
process.exit(1);
}