From 25cee4135879e1b9dfa2427c7375306144af99ad Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Fri, 8 Dec 2017 13:05:24 -0800 Subject: Add @0xproject scope to abi-gen package name --- packages/abi-gen/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 9ce64f818..33801d6c0 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,5 +1,5 @@ { - "name": "abi-gen", + "name": "@0xproject/abi-gen", "version": "0.0.1", "description": "Generate contract wrappers from ABI and handlebars templates", "main": "lib/index.js", -- cgit v1.2.3 From a6f97181310c9acba176b2a28ffba1ca7d53727d Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Fri, 8 Dec 2017 13:17:03 -0800 Subject: Publish - 0x.js@0.27.2 - abi-gen-templates@0.0.2 - @0xproject/abi-gen@0.0.2 - @0xproject/assert@0.0.7 - @0xproject/connect@0.3.0 - contracts@2.0.0 - @0xproject/json-schemas@0.6.10 - @0xproject/monorepo-scripts@0.1.0 - @0xproject/subproviders@0.1.0 - @0xproject/tslint-config@0.2.1 - @0xproject/types@0.1.0 - @0xproject/utils@0.1.0 - @0xproject/web3-wrapper@0.1.0 - website@0.0.2 --- packages/abi-gen/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 33801d6c0..a5c27b907 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.0.1", + "version": "0.0.2", "description": "Generate contract wrappers from ABI and handlebars templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -33,7 +33,7 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/tslint-config": "^0.2.0", + "@0xproject/tslint-config": "^0.2.1", "@types/glob": "^5.0.33", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", -- cgit v1.2.3 From 9c6453e12969bb3564e3146e66806476d7cd7b21 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Fri, 8 Dec 2017 14:56:56 -0800 Subject: Fix broken postpublish_utils, add CHANGELOG and postpublish.js scripts to all packages --- packages/abi-gen/CHANGELOG.md | 4 ++++ packages/abi-gen/scripts/postpublish.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 packages/abi-gen/CHANGELOG.md create mode 100644 packages/abi-gen/scripts/postpublish.js (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md new file mode 100644 index 000000000..b4cce6be0 --- /dev/null +++ b/packages/abi-gen/CHANGELOG.md @@ -0,0 +1,4 @@ +# CHANGELOG + +vx.x.x +------------------------ diff --git a/packages/abi-gen/scripts/postpublish.js b/packages/abi-gen/scripts/postpublish.js new file mode 100644 index 000000000..7fa452b08 --- /dev/null +++ b/packages/abi-gen/scripts/postpublish.js @@ -0,0 +1,14 @@ +const postpublish_utils = require('../../../scripts/postpublish_utils'); +const packageJSON = require('../package.json'); + +const subPackageName = packageJSON.name; + +postpublish_utils.getLatestTagAndVersionAsync(subPackageName) + .then(function(result) { + const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); + const assets = []; + return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); + }) + .catch (function(err) { + throw err; + }); -- cgit v1.2.3 From 02e7354b5324b80f1e5a6a2968d05de44820498c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 8 Dec 2017 17:58:54 +0300 Subject: Move 0x.js temnplates to 0x.js instead of having them as a separate package --- packages/abi-gen/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/README.md b/packages/abi-gen/README.md index 16dd9b969..0eaacd86f 100644 --- a/packages/abi-gen/README.md +++ b/packages/abi-gen/README.md @@ -5,7 +5,7 @@ It's heavily inspired by [Geth abigen](https://github.com/ethereum/go-ethereum/w 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 an 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/abi-gen-templates) are the templates used to generate those files. +[Here](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/src/contract_templates) are the templates used to generate those files. ## Instalation `yarn add -g @0xproject/abi-gen` @@ -29,7 +29,7 @@ We could've just used `--abiGlob 'src/artifacts/*.json` but we wanted to exclude The abi file should be either a [Truffle](http://truffleframework.com/) contract artifact (a JSON object with an 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/abi-gen-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.js/tree/development/packages/0x.js/src/contract_templates) and start 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 a partials folder - they will be registered and available. ## Which data/context do I get in my templates? -- cgit v1.2.3 From a5d2cbfd6f9d7e86807bf2c4fb3a045722153e58 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 18 Dec 2017 16:27:14 +0100 Subject: Install types for yargs --- packages/abi-gen/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index a5c27b907..00943f063 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -38,7 +38,7 @@ "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", "@types/node": "^8.0.53", - "@types/yargs": "^8.0.2", + "@types/yargs": "^10.0.0", "npm-run-all": "^4.1.2", "shx": "^0.2.2", "tslint": "5.8.0", -- cgit v1.2.3 From a2bf19efc1d1aef67ac6da321fe36c53135c6555 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 20 Dec 2017 17:10:12 +0100 Subject: Publish - 0x.js@0.28.0 - @0xproject/abi-gen@0.0.3 - @0xproject/assert@0.0.8 - @0xproject/connect@0.3.1 - contracts@2.1.0 - @0xproject/dev-utils@0.0.2 - @0xproject/json-schemas@0.7.0 - @0xproject/kovan_faucets@1.0.1 - @0xproject/monorepo-scripts@0.1.1 - @0xproject/subproviders@0.1.1 - @0xproject/tslint-config@0.3.0 - @0xproject/types@0.1.1 - @0xproject/utils@0.1.1 - @0xproject/web3-wrapper@0.1.1 - @0xproject/website@0.0.3 --- packages/abi-gen/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 00943f063..ee88595b9 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.0.2", + "version": "0.0.3", "description": "Generate contract wrappers from ABI and handlebars templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -33,7 +33,7 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/tslint-config": "^0.2.1", + "@0xproject/tslint-config": "^0.3.0", "@types/glob": "^5.0.33", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", -- cgit v1.2.3 From 31c9c82f6c00c890c4676d7fc8744d17d810db8b Mon Sep 17 00:00:00 2001 From: Nadav Hollander Date: Sun, 24 Dec 2017 10:05:52 -0800 Subject: Fix typing generation for arrays in which types separated by |s --- packages/abi-gen/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index eaf5a30cc..b3f60a02a 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -10,7 +10,7 @@ export const utils = { if (solType.match(trailingArrayRegex)) { const arrayItemSolType = solType.replace(trailingArrayRegex, ''); const arrayItemTsType = utils.solTypeToTsType(paramKind, arrayItemSolType); - const arrayTsType = `${arrayItemTsType}[]`; + const arrayTsType = `(${arrayItemTsType})[]`; return arrayTsType; } else { const solTypeRegexToTsType = [ -- cgit v1.2.3 From eda6b8d01b4e3c297d93b026b058aa23aa2de3ae Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Sun, 24 Dec 2017 19:39:50 -0500 Subject: Fix broken links in the abi-gen README --- packages/abi-gen/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/README.md b/packages/abi-gen/README.md index 0eaacd86f..ab2315232 100644 --- a/packages/abi-gen/README.md +++ b/packages/abi-gen/README.md @@ -5,9 +5,9 @@ It's heavily inspired by [Geth abigen](https://github.com/ethereum/go-ethereum/w 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 an 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/0x.js/src/contract_templates) are the templates used to generate those files. +[Here](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/contract_templates) are the templates used to generate those files. -## Instalation +## Installation `yarn add -g @0xproject/abi-gen` ## Usage ``` @@ -29,8 +29,8 @@ We could've just used `--abiGlob 'src/artifacts/*.json` but we wanted to exclude The abi file should be either a [Truffle](http://truffleframework.com/) contract artifact (a JSON object with an 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/0x.js/src/contract_templates) and start adjusting them for your needs. -We use [handlebars](handlebarsjs.com) template engine under the hood. +The best way to get started is to copy [0x.js templates](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/contract_templates) and start adjusting them for your needs. +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. ## Which data/context do I get in my templates? For now you don't get much on top of methods abi, some useful helpers and a contract name because it was enough for our use-case, but if you need something else - create a PR. -- cgit v1.2.3 From f684cc371104b594358fb8cd274e453c81f48881 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 28 Dec 2017 10:57:04 +0100 Subject: Publish - 0x.js@0.29.0 - @0xproject/abi-gen@0.0.4 - @0xproject/assert@0.0.9 - @0xproject/connect@0.3.2 - contracts@2.1.1 - @0xproject/dev-utils@0.0.3 - @0xproject/json-schemas@0.7.1 - @0xproject/kovan_faucets@1.0.2 - @0xproject/monorepo-scripts@0.1.2 - @0xproject/subproviders@0.2.0 - @0xproject/tslint-config@0.4.0 - @0xproject/types@0.1.2 - @0xproject/utils@0.1.2 - @0xproject/web3-wrapper@0.1.2 - @0xproject/website@0.0.4 --- packages/abi-gen/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index ee88595b9..db429d9a9 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.0.3", + "version": "0.0.4", "description": "Generate contract wrappers from ABI and handlebars templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -33,7 +33,7 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/tslint-config": "^0.3.0", + "@0xproject/tslint-config": "^0.4.0", "@types/glob": "^5.0.33", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", -- cgit v1.2.3 From 161a9d6ad20d7b127ef41a55dc12892e809127e5 Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Sat, 30 Dec 2017 16:13:32 +0100 Subject: Added Event generation to abi-gen --- packages/abi-gen/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index 19d289e49..6bd8bfe94 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -15,6 +15,7 @@ import {ContextData, ParamKind} from './types'; import {utils} from './utils'; const ABI_TYPE_METHOD = 'function'; +const ABI_TYPE_EVENT = 'event'; const MAIN_TEMPLATE_NAME = 'contract.mustache'; const args = yargs @@ -74,6 +75,7 @@ for (const abiFileName of abiFileNames) { utils.log(`Please make sure your ABI file is either an array with ABI entries or an object with the abi key`); process.exit(1); } + const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[]; const methodsData = _.map(methodAbis, methodAbi => { _.map(methodAbi.inputs, input => { @@ -89,9 +91,13 @@ for (const abiFileName of abiFileNames) { }; return methodData; }); + + const eventAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_EVENT) as Web3.MethodAbi[]; + const contextData = { contractName: namedContent.name, methods: methodsData, + events: eventAbis, }; const renderedTsCode = template(contextData); writeOutputFile(namedContent.name, renderedTsCode); -- cgit v1.2.3 From e744e4cd989bd3ae1070c59f7baa8097f18b8b06 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 22 Dec 2017 15:05:32 +0100 Subject: Apply prettier config --- packages/abi-gen/src/index.ts | 15 +++++++-------- packages/abi-gen/src/utils.ts | 21 ++++++++++++--------- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index 19d289e49..a74bdf8c4 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -2,7 +2,7 @@ import chalk from 'chalk'; import * as fs from 'fs'; -import {sync as globSync} from 'glob'; +import { sync as globSync } from 'glob'; import * as Handlebars from 'handlebars'; import * as _ from 'lodash'; import * as mkdirp from 'mkdirp'; @@ -11,8 +11,8 @@ import * as yargs from 'yargs'; import toSnakeCase = require('to-snake-case'); import * as Web3 from 'web3'; -import {ContextData, ParamKind} from './types'; -import {utils} from './utils'; +import { ContextData, ParamKind } from './types'; +import { utils } from './utils'; const ABI_TYPE_METHOD = 'function'; const MAIN_TEMPLATE_NAME = 'contract.mustache'; @@ -32,8 +32,7 @@ const args = yargs describe: 'Folder where to put the output files', type: 'string', demand: true, - }) - .argv; + }).argv; function writeOutputFile(name: string, renderedTsCode: string): void { const fileName = toSnakeCase(name); @@ -66,9 +65,9 @@ for (const abiFileName of abiFileNames) { const namedContent = utils.getNamedContent(abiFileName); utils.log(`Processing: ${chalk.bold(namedContent.name)}...`); const parsedContent = JSON.parse(namedContent.content); - const ABI = _.isArray(parsedContent) ? - parsedContent : // ABI file - parsedContent.abi; // Truffle contracts file + const ABI = _.isArray(parsedContent) + ? parsedContent // ABI file + : parsedContent.abi; // Truffle contracts file if (_.isUndefined(ABI)) { utils.log(`${chalk.red(`ABI not found in ${abiFileName}.`)}`); utils.log(`Please make sure your ABI file is either an array with ABI entries or an object with the abi key`); diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index eaf5a30cc..55e77f27d 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as _ from 'lodash'; import * as path from 'path'; -import {ParamKind} from './types'; +import { ParamKind } from './types'; export const utils = { solTypeToTsType(paramKind: ParamKind, solType: string): string { @@ -14,19 +14,22 @@ export const utils = { return arrayTsType; } else { const solTypeRegexToTsType = [ - {regex: '^string$', tsType: 'string'}, - {regex: '^address$', tsType: 'string'}, - {regex: '^bool$', tsType: 'boolean'}, - {regex: '^u?int\\d*$', tsType: 'BigNumber'}, - {regex: '^bytes\\d*$', tsType: 'string'}, + { regex: '^string$', tsType: 'string' }, + { regex: '^address$', tsType: 'string' }, + { regex: '^bool$', tsType: 'boolean' }, + { regex: '^u?int\\d*$', tsType: 'BigNumber' }, + { regex: '^bytes\\d*$', tsType: 'string' }, ]; if (paramKind === ParamKind.Input) { // web3 allows to pass those an non-bignumbers and that's nice // but it always returns stuff as BigNumbers - solTypeRegexToTsType.unshift({regex: '^u?int(8|16|32)?$', tsType: 'number|BigNumber'}); + solTypeRegexToTsType.unshift({ + regex: '^u?int(8|16|32)?$', + tsType: 'number|BigNumber', + }); } for (const regexAndTxType of solTypeRegexToTsType) { - const {regex, tsType} = regexAndTxType; + const { regex, tsType } = regexAndTxType; if (solType.match(regex)) { return tsType; } @@ -41,7 +44,7 @@ export const utils = { const name = path.parse(filename).name; return name; }, - getNamedContent(filename: string): {name: string; content: string} { + getNamedContent(filename: string): { name: string; content: string } { const name = utils.getPartialNameFromFileName(filename); try { const content = fs.readFileSync(filename).toString(); -- cgit v1.2.3 From 94c75b5262a4837490de33d0968462d6b46546b6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 3 Jan 2018 12:05:44 +0100 Subject: Add #302 description to changelog --- packages/abi-gen/CHANGELOG.md | 3 ++- packages/abi-gen/src/index.ts | 2 +- packages/abi-gen/src/types.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index b4cce6be0..c7fcd2a6c 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -1,4 +1,5 @@ # CHANGELOG -vx.x.x +v0.x.x - _TBD, 2018_ ------------------------ +* Add event ABIs to context data passed to templates (#302) diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index bcb4a468b..ed71087b2 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -91,7 +91,7 @@ for (const abiFileName of abiFileNames) { return methodData; }); - const eventAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_EVENT) as Web3.MethodAbi[]; + const eventAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_EVENT) as Web3.EventAbi[]; const contextData = { contractName: namedContent.name, diff --git a/packages/abi-gen/src/types.ts b/packages/abi-gen/src/types.ts index 1dc039c83..8b158d77a 100644 --- a/packages/abi-gen/src/types.ts +++ b/packages/abi-gen/src/types.ts @@ -12,4 +12,5 @@ export interface Method extends Web3.MethodAbi { export interface ContextData { contractName: string; methods: Method[]; + events: Web3.EventAbi[]; } -- cgit v1.2.3 From ce6abad97f248a3557390dd1e1ff3ae84662838f Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 3 Jan 2018 12:08:39 +0100 Subject: Describe #295 in a CHANGELOG --- packages/abi-gen/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index c7fcd2a6c..346bba4bf 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -2,4 +2,5 @@ v0.x.x - _TBD, 2018_ ------------------------ +* Fixed array typings with union types (#295) * Add event ABIs to context data passed to templates (#302) -- cgit v1.2.3 From f3b8bac47787a13ea4360b992bbe550bec2c3e19 Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Wed, 3 Jan 2018 15:48:29 +0100 Subject: Added constructor ABIs to abi-gen Additionally if the constructor is not existent in JSON, meaning it's implcite with no parameters, we're explicitly creating one, with actual JSON parameters that it should have. --- packages/abi-gen/package.json | 2 +- packages/abi-gen/src/index.ts | 7 +++++++ packages/abi-gen/src/utils.ts | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index db429d9a9..fbf3db687 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -43,6 +43,6 @@ "shx": "^0.2.2", "tslint": "5.8.0", "typescript": "~2.6.1", - "web3-typescript-typings": "^0.7.2" + "web3-typescript-typings": "^0.9.0" } } diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index ed71087b2..65dc1c607 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -14,6 +14,7 @@ import * as Web3 from 'web3'; import { ContextData, ParamKind } from './types'; import { utils } from './utils'; +const ABI_TYPE_CONSTRUCTOR = 'constructor'; const ABI_TYPE_METHOD = 'function'; const ABI_TYPE_EVENT = 'event'; const MAIN_TEMPLATE_NAME = 'contract.mustache'; @@ -75,6 +76,11 @@ for (const abiFileName of abiFileNames) { process.exit(1); } + let constructor = ABI.find((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as Web3.ConstructorAbi; + if (!constructor) { + constructor = utils.getEmptyConstructor(); // The constructor exists, but it's implicit in JSON's ABI definition + } + const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[]; const methodsData = _.map(methodAbis, methodAbi => { _.map(methodAbi.inputs, input => { @@ -95,6 +101,7 @@ for (const abiFileName of abiFileNames) { const contextData = { contractName: namedContent.name, + constructor, methods: methodsData, events: eventAbis, }; diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index 764daa142..524c54a5e 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -1,6 +1,7 @@ import * as fs from 'fs'; import * as _ from 'lodash'; import * as path from 'path'; +import * as Web3 from 'web3'; import { ParamKind } from './types'; @@ -56,4 +57,12 @@ export const utils = { throw new Error(`Failed to read ${filename}: ${err}`); } }, + getEmptyConstructor(): Web3.ConstructorAbi { + return { + type: 'constructor', + stateMutability: 'nonpayable', + payable: false, + inputs: [], + }; + }, }; -- cgit v1.2.3 From 4dfa720f2dec2be0b0758633c087579a02e482bb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 12:38:19 +0100 Subject: Use configured version of bignumber in all packages --- packages/abi-gen/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index db429d9a9..91438eff5 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md", "dependencies": { - "bignumber.js": "~4.1.0", + "@0xproject/utils": "^0.1.2", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", -- cgit v1.2.3 From c49f68ef3ebb11f779868b35f938c1d1cb08c665 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 14:53:38 +0100 Subject: Fix linter errors --- packages/abi-gen/src/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index 764daa142..f407ae23d 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -10,7 +10,7 @@ export const utils = { if (solType.match(trailingArrayRegex)) { const arrayItemSolType = solType.replace(trailingArrayRegex, ''); const arrayItemTsType = utils.solTypeToTsType(paramKind, arrayItemSolType); - const arrayTsType = `(${arrayItemTsType})[]`; + const arrayTsType = utils.isUnionType(arrayItemTsType) ? `Array<${arrayItemTsType}>` : `${arrayItemTsType}[]`; return arrayTsType; } else { const solTypeRegexToTsType = [ @@ -37,6 +37,9 @@ export const utils = { throw new Error(`Unknown Solidity type found: ${solType}`); } }, + isUnionType(tsType: string): boolean { + return tsType === 'number|BigNumber'; + }, log(...args: any[]): void { console.log(...args); // tslint:disable-line:no-console }, -- cgit v1.2.3 From 326a6b729fe6cf96f0b4787d84903282738b6863 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 16:31:46 +0100 Subject: Fix prettier --- packages/abi-gen/src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index f407ae23d..edda016b5 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -10,7 +10,9 @@ export const utils = { if (solType.match(trailingArrayRegex)) { const arrayItemSolType = solType.replace(trailingArrayRegex, ''); const arrayItemTsType = utils.solTypeToTsType(paramKind, arrayItemSolType); - const arrayTsType = utils.isUnionType(arrayItemTsType) ? `Array<${arrayItemTsType}>` : `${arrayItemTsType}[]`; + const arrayTsType = utils.isUnionType(arrayItemTsType) + ? `Array<${arrayItemTsType}>` + : `${arrayItemTsType}[]`; return arrayTsType; } else { const solTypeRegexToTsType = [ -- cgit v1.2.3 From c700046b7673a0f470c8d8abeec3cf873049a78a Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 12:54:16 +0100 Subject: Apply prettify on json and md files --- packages/abi-gen/CHANGELOG.md | 4 +- packages/abi-gen/README.md | 13 +++++- packages/abi-gen/package.json | 92 +++++++++++++++++++++--------------------- packages/abi-gen/tsconfig.json | 26 +++++------- packages/abi-gen/tslint.json | 4 +- 5 files changed, 72 insertions(+), 67 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index 346bba4bf..700cfb549 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -v0.x.x - _TBD, 2018_ ------------------------- +## v0.x.x - _TBD, 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 ab2315232..1188bd437 100644 --- a/packages/abi-gen/README.md +++ b/packages/abi-gen/README.md @@ -8,8 +8,11 @@ For an example of the generated [wrapper files](https://github.com/0xProject/0x. [Here](https://github.com/0xProject/0x.js/tree/development/packages/0x.js/contract_templates) are the templates used to generate those files. ## Installation + `yarn add -g @0xproject/abi-gen` + ## Usage + ``` abi-gen Options: @@ -19,8 +22,10 @@ Options: --templates Folder where to search for templates [string] [required] --output Folder where to put the output files [string] [required] ``` + ## ABI files -You're required to pass a [glob](https://en.wikipedia.org/wiki/Glob_(programming)) template where your abi files are located. + +You're required to pass a [glob]() template where your abi files are located. TL;DR - here is the example from 0x.js. `--abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json` @@ -28,12 +33,18 @@ TL;DR - here is the example from 0x.js. We could've just used `--abiGlob 'src/artifacts/*.json` but we wanted to exclude some of the abi files. The abi file should be either a [Truffle](http://truffleframework.com/) contract artifact (a JSON object with an 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/0x.js/contract_templates) and start adjusting them for your needs. 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. + ## Which data/context do I get in my templates? + For now you don't get much on top of methods abi, some useful helpers and a contract name because it was enough for our use-case, but if you need something else - create a PR. See the [type definition](https://github.com/0xProject/0x.js/tree/development/packages/abi-gen/src/types.ts) of what we pass to the render method. + ## Output files + Output files will be generated within an output folder with names converted to camel case and taken from abi file names. If you already have some files in that folder they will be overwritten. diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 91438eff5..e2307bccd 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,48 +1,48 @@ { - "name": "@0xproject/abi-gen", - "version": "0.0.4", - "description": "Generate contract wrappers from ABI and handlebars templates", - "main": "lib/index.js", - "types": "lib/index.d.ts", - "scripts": { - "lint": "tslint --project . 'src/**/*.ts'", - "clean": "shx rm -rf lib", - "build": "tsc" - }, - "bin": { - "abi-gen": "lib/index.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/0xProject/0x.js.git" - }, - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/0xProject/0x.js/issues" - }, - "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md", - "dependencies": { - "@0xproject/utils": "^0.1.2", - "chalk": "^2.3.0", - "glob": "^7.1.2", - "handlebars": "^4.0.11", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "to-snake-case": "^1.0.0", - "web3": "^0.20.0", - "yargs": "^10.0.3" - }, - "devDependencies": { - "@0xproject/tslint-config": "^0.4.0", - "@types/glob": "^5.0.33", - "@types/handlebars": "^4.0.36", - "@types/mkdirp": "^0.5.1", - "@types/node": "^8.0.53", - "@types/yargs": "^10.0.0", - "npm-run-all": "^4.1.2", - "shx": "^0.2.2", - "tslint": "5.8.0", - "typescript": "~2.6.1", - "web3-typescript-typings": "^0.7.2" - } + "name": "@0xproject/abi-gen", + "version": "0.0.4", + "description": "Generate contract wrappers from ABI and handlebars templates", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "scripts": { + "lint": "tslint --project . 'src/**/*.ts'", + "clean": "shx rm -rf lib", + "build": "tsc" + }, + "bin": { + "abi-gen": "lib/index.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/0xProject/0x.js.git" + }, + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/0xProject/0x.js/issues" + }, + "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md", + "dependencies": { + "@0xproject/utils": "^0.1.2", + "chalk": "^2.3.0", + "glob": "^7.1.2", + "handlebars": "^4.0.11", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "to-snake-case": "^1.0.0", + "web3": "^0.20.0", + "yargs": "^10.0.3" + }, + "devDependencies": { + "@0xproject/tslint-config": "^0.4.0", + "@types/glob": "^5.0.33", + "@types/handlebars": "^4.0.36", + "@types/mkdirp": "^0.5.1", + "@types/node": "^8.0.53", + "@types/yargs": "^10.0.0", + "npm-run-all": "^4.1.2", + "shx": "^0.2.2", + "tslint": "5.8.0", + "typescript": "~2.6.1", + "web3-typescript-typings": "^0.7.2" + } } diff --git a/packages/abi-gen/tsconfig.json b/packages/abi-gen/tsconfig.json index 695f2a47e..c9a7e9189 100644 --- a/packages/abi-gen/tsconfig.json +++ b/packages/abi-gen/tsconfig.json @@ -1,17 +1,13 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "lib": ["es2015", "dom"], - "outDir": "lib", - "sourceMap": true, - "declaration": true, - "noImplicitAny": true, - "strictNullChecks": true - }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts" - ] + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": ["es2015", "dom"], + "outDir": "lib", + "sourceMap": true, + "declaration": true, + "noImplicitAny": true, + "strictNullChecks": true + }, + "include": ["./src/**/*", "./test/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] } diff --git a/packages/abi-gen/tslint.json b/packages/abi-gen/tslint.json index a07795151..ffaefe83a 100644 --- a/packages/abi-gen/tslint.json +++ b/packages/abi-gen/tslint.json @@ -1,5 +1,3 @@ { - "extends": [ - "@0xproject/tslint-config" - ] + "extends": ["@0xproject/tslint-config"] } -- cgit v1.2.3 From e019ae4aed610c4645894c2999871fd3c0b57388 Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Fri, 5 Jan 2018 02:07:25 +0100 Subject: Changes to abi-gen after code review * Added change to CHANGELOG * Renamed variable and context to ctor to avoid keyword * Used lodash' isUndefined to better check ctor --- packages/abi-gen/CHANGELOG.md | 1 + packages/abi-gen/src/index.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index 346bba4bf..0afd6abd4 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -4,3 +4,4 @@ v0.x.x - _TBD, 2018_ ------------------------ * Fixed array typings with union types (#295) * Add event ABIs to context data passed to templates (#302) +* Add constructor ABIs to context data passed to templates (#304) \ No newline at end of file diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index 65dc1c607..527af32b1 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -76,9 +76,9 @@ for (const abiFileName of abiFileNames) { process.exit(1); } - let constructor = ABI.find((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as Web3.ConstructorAbi; - if (!constructor) { - constructor = utils.getEmptyConstructor(); // The constructor exists, but it's implicit in JSON's ABI definition + let ctor = ABI.find((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as Web3.ConstructorAbi; + if (_.isUndefined(ctor)) { + ctor = utils.getEmptyConstructor(); // The constructor exists, but it's implicit in JSON's ABI definition } const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[]; @@ -101,7 +101,7 @@ for (const abiFileName of abiFileNames) { const contextData = { contractName: namedContent.name, - constructor, + ctor, methods: methodsData, events: eventAbis, }; -- cgit v1.2.3 From e6a783aff803c276392efec93571d24fc96feb6e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 10 Jan 2018 11:24:00 +0100 Subject: Apply prettier --- packages/abi-gen/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index 983f7a3d1..c8158089a 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -4,4 +4,4 @@ * Fixed array typings with union types (#295) * Add event ABIs to context data passed to templates (#302) -* Add constructor ABIs to context data passed to templates (#304) \ No newline at end of file +* Add constructor ABIs to context data passed to templates (#304) -- cgit v1.2.3 From 27d9fba785a5a53550be53b12baf9069bda8d160 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 18:56:30 +0100 Subject: Include web3 types via typeRoots and factor out common parts of tsconfig.json --- packages/abi-gen/tsconfig.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/tsconfig.json b/packages/abi-gen/tsconfig.json index c9a7e9189..e35816553 100644 --- a/packages/abi-gen/tsconfig.json +++ b/packages/abi-gen/tsconfig.json @@ -1,13 +1,7 @@ { + "extends": "../../tsconfig", "compilerOptions": { - "module": "commonjs", - "target": "es5", - "lib": ["es2015", "dom"], - "outDir": "lib", - "sourceMap": true, - "declaration": true, - "noImplicitAny": true, - "strictNullChecks": true + "outDir": "lib" }, - "include": ["./src/**/*", "./test/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*", "./test/**/*"] } -- cgit v1.2.3 From 78fd942faa752980caba6e37edd2932b1235cfd7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 5 Jan 2018 13:32:01 +0100 Subject: Return to old way of including web3 types --- packages/abi-gen/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/tsconfig.json b/packages/abi-gen/tsconfig.json index e35816553..5e0c7c6d3 100644 --- a/packages/abi-gen/tsconfig.json +++ b/packages/abi-gen/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./src/**/*", "./test/**/*"] + "include": ["./src/**/*", "./test/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] } -- cgit v1.2.3 From 0f8b2703d19f41adf96d2ec351b4da30d4ce636e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 10 Jan 2018 11:28:43 +0100 Subject: Fix a compiler error with constructor enum --- packages/abi-gen/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index f6291d98d..b9149e850 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -64,7 +64,7 @@ export const utils = { }, getEmptyConstructor(): Web3.ConstructorAbi { return { - type: 'constructor', + type: Web3.AbiType.Constructor, stateMutability: 'nonpayable', payable: false, inputs: [], -- cgit v1.2.3 From fa7237fde7acea32c5492f0dcdef4d55b3ade6e1 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 10 Jan 2018 12:00:39 +0100 Subject: Fix a compiler error in abi-gen --- packages/abi-gen/src/types.ts | 7 +++++++ packages/abi-gen/src/utils.ts | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/src/types.ts b/packages/abi-gen/src/types.ts index 8b158d77a..e82ab824b 100644 --- a/packages/abi-gen/src/types.ts +++ b/packages/abi-gen/src/types.ts @@ -5,6 +5,13 @@ export enum ParamKind { Output = 'output', } +export enum AbiType { + Function = 'function', + Constructor = 'constructor', + Event = 'event', + Fallback = 'fallback', +} + export interface Method extends Web3.MethodAbi { singleReturnValue: boolean; } diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index b9149e850..14255643a 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -3,7 +3,7 @@ import * as _ from 'lodash'; import * as path from 'path'; import * as Web3 from 'web3'; -import { ParamKind } from './types'; +import { AbiType, ParamKind } from './types'; export const utils = { solTypeToTsType(paramKind: ParamKind, solType: string): string { @@ -64,7 +64,7 @@ export const utils = { }, getEmptyConstructor(): Web3.ConstructorAbi { return { - type: Web3.AbiType.Constructor, + type: AbiType.Constructor, stateMutability: 'nonpayable', payable: false, inputs: [], -- cgit v1.2.3 From 7f4a383d753b1474b18b8f7190c4ce23b5e62e4d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 11 Jan 2018 13:03:38 +0100 Subject: Update CHANGELOGs before publish --- packages/abi-gen/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md index c8158089a..fb2c6eb24 100644 --- a/packages/abi-gen/CHANGELOG.md +++ b/packages/abi-gen/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## v0.x.x - _TBD, 2018_ +## v0.1.0 - _January 11, 2018_ * Fixed array typings with union types (#295) * Add event ABIs to context data passed to templates (#302) -- cgit v1.2.3 From 31b3ac4b98dc9fc5f2588a2dc4664de1dea5f49c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 11 Jan 2018 13:05:49 +0100 Subject: Publish - 0x.js@0.29.1 - @0xproject/abi-gen@0.1.0 - @0xproject/assert@0.0.10 - @0xproject/connect@0.4.0 - contracts@2.1.2 - @0xproject/dev-utils@0.0.4 - @0xproject/json-schemas@0.7.2 - @0xproject/kovan_faucets@1.0.3 - @0xproject/monorepo-scripts@0.1.3 - @0xproject/subproviders@0.3.0 - @0xproject/tslint-config@0.4.1 - @0xproject/types@0.1.3 - @0xproject/utils@0.1.3 - web3-typescript-typings@0.9.1 - @0xproject/web3-wrapper@0.1.3 - @0xproject/website@0.0.5 --- packages/abi-gen/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index b42a7fbce..8e640309d 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.0.4", + "version": "0.1.0", "description": "Generate contract wrappers from ABI and handlebars templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md", "dependencies": { - "@0xproject/utils": "^0.1.2", + "@0xproject/utils": "^0.1.3", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", @@ -33,7 +33,7 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.0", + "@0xproject/tslint-config": "^0.4.1", "@types/glob": "^5.0.33", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", @@ -43,6 +43,6 @@ "shx": "^0.2.2", "tslint": "5.8.0", "typescript": "~2.6.1", - "web3-typescript-typings": "^0.9.0" + "web3-typescript-typings": "^0.9.1" } } -- cgit v1.2.3 From 2bba1ae292ed9756f86bc5b172f5cf52f3780d87 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 11 Jan 2018 14:43:58 +0100 Subject: Publish - 0x.js@0.29.2 - @0xproject/abi-gen@0.1.1 - @0xproject/connect@0.4.1 - contracts@2.1.3 - @0xproject/kovan_faucets@1.0.4 - web3-typescript-typings@0.9.3 - @0xproject/web3-wrapper@0.1.4 - @0xproject/website@0.0.6 --- packages/abi-gen/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 8e640309d..05f7a8778 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.1.0", + "version": "0.1.1", "description": "Generate contract wrappers from ABI and handlebars templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -43,6 +43,6 @@ "shx": "^0.2.2", "tslint": "5.8.0", "typescript": "~2.6.1", - "web3-typescript-typings": "^0.9.1" + "web3-typescript-typings": "^0.9.3" } } -- cgit v1.2.3 From feace988b4f6f361adb45ed17f16c3d7f5d9a514 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 12 Jan 2018 21:53:11 +0100 Subject: Add postpublish scripts --- packages/abi-gen/scripts/postpublish.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/scripts/postpublish.js b/packages/abi-gen/scripts/postpublish.js index 7fa452b08..16d67e03f 100644 --- a/packages/abi-gen/scripts/postpublish.js +++ b/packages/abi-gen/scripts/postpublish.js @@ -3,12 +3,13 @@ const packageJSON = require('../package.json'); const subPackageName = packageJSON.name; -postpublish_utils.getLatestTagAndVersionAsync(subPackageName) +postpublish_utils + .getLatestTagAndVersionAsync(subPackageName) .then(function(result) { const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version); const assets = []; return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets); }) - .catch (function(err) { + .catch(function(err) { throw err; }); -- cgit v1.2.3 From d58bfb46cf50131d361ad0cbd08ef44454f8930e Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 17 Jan 2018 22:45:09 -0800 Subject: Publish - 0x.js@0.30.0 - @0xproject/abi-gen@0.1.2 - @0xproject/assert@0.0.11 - chai-as-promised-typescript-typings@0.0.4 - chai-typescript-typings@0.0.2 - @0xproject/connect@0.5.0 - contracts@2.1.4 - @0xproject/dev-utils@0.0.5 - @0xproject/json-schemas@0.7.3 - @0xproject/kovan_faucets@1.0.5 - @0xproject/monorepo-scripts@0.1.4 - @0xproject/subproviders@0.3.1 - @0xproject/tslint-config@0.4.2 - @0xproject/types@0.1.4 - @0xproject/utils@0.2.0 - web3-typescript-typings@0.9.4 - @0xproject/web3-wrapper@0.1.5 - @0xproject/website@0.0.7 --- packages/abi-gen/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 05f7a8778..87364c73e 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.1.1", + "version": "0.1.2", "description": "Generate contract wrappers from ABI and handlebars templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md", "dependencies": { - "@0xproject/utils": "^0.1.3", + "@0xproject/utils": "^0.2.0", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", @@ -33,7 +33,7 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.1", + "@0xproject/tslint-config": "^0.4.2", "@types/glob": "^5.0.33", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", @@ -43,6 +43,6 @@ "shx": "^0.2.2", "tslint": "5.8.0", "typescript": "~2.6.1", - "web3-typescript-typings": "^0.9.3" + "web3-typescript-typings": "^0.9.4" } } -- cgit v1.2.3 From f58f0ddb67555c3f0c7252ea3e003824984c48ad Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 24 Jan 2018 17:02:13 +0100 Subject: Publish - 0x.js@0.30.1 - @0xproject/abi-gen@0.1.3 - @0xproject/assert@0.0.12 - chai-as-promised-typescript-typings@0.0.5 - @0xproject/connect@0.5.1 - contracts@2.1.5 - @0xproject/deployer@0.0.2 - @0xproject/dev-utils@0.0.6 - @0xproject/json-schemas@0.7.4 - @0xproject/kovan_faucets@1.0.6 - @0xproject/monorepo-scripts@0.1.5 - @0xproject/subproviders@0.3.2 - @0xproject/tslint-config@0.4.3 - @0xproject/types@0.1.5 - @0xproject/utils@0.2.1 - web3-typescript-typings@0.9.5 - @0xproject/web3-wrapper@0.1.6 - @0xproject/website@0.0.8 --- packages/abi-gen/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/abi-gen') diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 87364c73e..8d2dee18a 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/abi-gen", - "version": "0.1.2", + "version": "0.1.3", "description": "Generate contract wrappers from ABI and handlebars templates", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md", "dependencies": { - "@0xproject/utils": "^0.2.0", + "@0xproject/utils": "^0.2.1", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", @@ -33,7 +33,7 @@ "yargs": "^10.0.3" }, "devDependencies": { - "@0xproject/tslint-config": "^0.4.2", + "@0xproject/tslint-config": "^0.4.3", "@types/glob": "^5.0.33", "@types/handlebars": "^4.0.36", "@types/mkdirp": "^0.5.1", @@ -43,6 +43,6 @@ "shx": "^0.2.2", "tslint": "5.8.0", "typescript": "~2.6.1", - "web3-typescript-typings": "^0.9.4" + "web3-typescript-typings": "^0.9.5" } } -- cgit v1.2.3