From 06cc66005cf0713fcc877ae67b51b38fb110b09d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 22 Nov 2018 14:16:08 +0100 Subject: [PATCH 1/2] Make contract-templates an npm package --- package.json | 6 +++--- packages/0x.js/package.json | 1 - packages/abi-gen-wrappers/package.json | 3 ++- packages/contract-templates/CHANGELOG.json | 11 ++++++++++ .../README.md | 0 .../contract.handlebars | 0 packages/contract-templates/package.json | 20 +++++++++++++++++++ .../partials/call.handlebars | 0 .../partials/callAsync.handlebars | 0 .../partials/event.handlebars | 0 .../partials/params.handlebars | 0 .../partials/return_type.handlebars | 0 .../partials/tx.handlebars | 0 .../partials/typed_params.handlebars | 0 packages/contracts/package.json | 2 +- packages/metacoin/package.json | 3 ++- 16 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 packages/contract-templates/CHANGELOG.json rename packages/{contract_templates => contract-templates}/README.md (100%) rename packages/{contract_templates => contract-templates}/contract.handlebars (100%) create mode 100644 packages/contract-templates/package.json rename packages/{contract_templates => contract-templates}/partials/call.handlebars (100%) rename packages/{contract_templates => contract-templates}/partials/callAsync.handlebars (100%) rename packages/{contract_templates => contract-templates}/partials/event.handlebars (100%) rename packages/{contract_templates => contract-templates}/partials/params.handlebars (100%) rename packages/{contract_templates => contract-templates}/partials/return_type.handlebars (100%) rename packages/{contract_templates => contract-templates}/partials/tx.handlebars (100%) rename packages/{contract_templates => contract-templates}/partials/typed_params.handlebars (100%) diff --git a/package.json b/package.json index 8b74aad676..bc9fd06ed5 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,9 @@ "install:all": "yarn install", "wsrun": "wsrun", "lerna": "lerna", - "build": "wsrun build $PKG --fast-exit -r --stages", - "build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0x/website", - "build:ci:no_website": "wsrun build:ci $PKG --fast-exit -r --stages --exclude @0x/website", + "build": "wsrun build $PKG --fast-exit -r --stages --exclude-missing", + "build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0x/website --exclude-missing", + "build:ci:no_website": "wsrun build:ci $PKG --fast-exit -r --stages --exclude @0x/website --exclude-missing", "build:monorepo_scripts": "PKG=@0x/monorepo-scripts yarn build", "build:ts": "tsc -b", "watch:ts": "tsc -b -w", diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index bc7ee2c874..3850e90386 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -42,7 +42,6 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0x/abi-gen": "^1.0.17", "@0x/abi-gen-wrappers": "^1.1.0", "@0x/contract-addresses": "^1.2.0", "@0x/dev-utils": "^1.0.18", diff --git a/packages/abi-gen-wrappers/package.json b/packages/abi-gen-wrappers/package.json index 0977ca03a4..df1c484ec2 100644 --- a/packages/abi-gen-wrappers/package.json +++ b/packages/abi-gen-wrappers/package.json @@ -15,7 +15,7 @@ "lint": "tslint --format stylish --project .", "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" + "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/contract-templates/contract.handlebars --partials '../../node_modules/@0x/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" @@ -31,6 +31,7 @@ "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md", "devDependencies": { "@0x/abi-gen": "^1.0.17", + "@0x/contract-templates": "^1.0.0", "@0x/tslint-config": "^1.0.10", "@0x/types": "^1.3.0", "@0x/utils": "^2.0.6", diff --git a/packages/contract-templates/CHANGELOG.json b/packages/contract-templates/CHANGELOG.json new file mode 100644 index 0000000000..adf615b3be --- /dev/null +++ b/packages/contract-templates/CHANGELOG.json @@ -0,0 +1,11 @@ +[ + { + "version": "1.0.0", + "changes": [ + { + "note": "Initial publish", + "pr": 1305 + } + ] + } +] diff --git a/packages/contract_templates/README.md b/packages/contract-templates/README.md similarity index 100% rename from packages/contract_templates/README.md rename to packages/contract-templates/README.md diff --git a/packages/contract_templates/contract.handlebars b/packages/contract-templates/contract.handlebars similarity index 100% rename from packages/contract_templates/contract.handlebars rename to packages/contract-templates/contract.handlebars diff --git a/packages/contract-templates/package.json b/packages/contract-templates/package.json new file mode 100644 index 0000000000..f79ae89311 --- /dev/null +++ b/packages/contract-templates/package.json @@ -0,0 +1,20 @@ +{ + "name": "@0x/contract-templates", + "version": "1.0.0", + "engines": { + "node": ">=6.12" + }, + "description": "Handlebars templates used by abi-gen to generate contract-wrappers", + "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/contract-templates/README.md", + "publishConfig": { + "access": "public" + } +} diff --git a/packages/contract_templates/partials/call.handlebars b/packages/contract-templates/partials/call.handlebars similarity index 100% rename from packages/contract_templates/partials/call.handlebars rename to packages/contract-templates/partials/call.handlebars diff --git a/packages/contract_templates/partials/callAsync.handlebars b/packages/contract-templates/partials/callAsync.handlebars similarity index 100% rename from packages/contract_templates/partials/callAsync.handlebars rename to packages/contract-templates/partials/callAsync.handlebars diff --git a/packages/contract_templates/partials/event.handlebars b/packages/contract-templates/partials/event.handlebars similarity index 100% rename from packages/contract_templates/partials/event.handlebars rename to packages/contract-templates/partials/event.handlebars diff --git a/packages/contract_templates/partials/params.handlebars b/packages/contract-templates/partials/params.handlebars similarity index 100% rename from packages/contract_templates/partials/params.handlebars rename to packages/contract-templates/partials/params.handlebars diff --git a/packages/contract_templates/partials/return_type.handlebars b/packages/contract-templates/partials/return_type.handlebars similarity index 100% rename from packages/contract_templates/partials/return_type.handlebars rename to packages/contract-templates/partials/return_type.handlebars diff --git a/packages/contract_templates/partials/tx.handlebars b/packages/contract-templates/partials/tx.handlebars similarity index 100% rename from packages/contract_templates/partials/tx.handlebars rename to packages/contract-templates/partials/tx.handlebars diff --git a/packages/contract_templates/partials/typed_params.handlebars b/packages/contract-templates/partials/typed_params.handlebars similarity index 100% rename from packages/contract_templates/partials/typed_params.handlebars rename to packages/contract-templates/partials/typed_params.handlebars diff --git a/packages/contracts/package.json b/packages/contracts/package.json index e10678d83d..4fb0838f40 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -22,7 +22,7 @@ "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", "clean": "shx rm -rf lib generated-artifacts generated-wrappers", - "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers", + "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/contract-templates/contract.handlebars --partials '../../node_modules/@0x/contract-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers", "lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts", "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index c5679a1d60..8081c03c93 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -18,7 +18,7 @@ "test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov", "test:profile": "SOLIDITY_PROFILER=true run-s build run_mocha profiler:report:html", "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --bail --exit --timeout 10000", - "generate_contract_wrappers": "abi-gen --abis 'artifacts/Metacoin.json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers", + "generate_contract_wrappers": "abi-gen --abis 'artifacts/Metacoin.json' --template ../../node_modules/@0x/contract-templates/contract.handlebars --partials '../../node_modules/@0x/contract-templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers", "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", "profiler:report:html": "istanbul report html && open coverage/index.html", @@ -30,6 +30,7 @@ "license": "Apache-2.0", "dependencies": { "@0x/abi-gen": "^1.0.17", + "@0x/contract-templates": "^1.0.0", "@0x/base-contract": "^3.0.7", "@0x/sol-cov": "^2.1.13", "@0x/subproviders": "^2.1.5", From 9ddd45e2c687280041cc0bb4cd7cb3c1a2c22767 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 23 Nov 2018 15:22:16 +0100 Subject: [PATCH 2/2] Rename contract-templates to abi-gen-templates --- .../{contract-templates => abi-gen-templates}/CHANGELOG.json | 0 packages/{contract-templates => abi-gen-templates}/README.md | 0 .../contract.handlebars | 0 .../{contract-templates => abi-gen-templates}/package.json | 4 ++-- .../partials/call.handlebars | 0 .../partials/callAsync.handlebars | 0 .../partials/event.handlebars | 0 .../partials/params.handlebars | 0 .../partials/return_type.handlebars | 0 .../partials/tx.handlebars | 0 .../partials/typed_params.handlebars | 0 packages/abi-gen-wrappers/package.json | 4 ++-- packages/contracts/package.json | 2 +- packages/metacoin/package.json | 4 ++-- 14 files changed, 7 insertions(+), 7 deletions(-) rename packages/{contract-templates => abi-gen-templates}/CHANGELOG.json (100%) rename packages/{contract-templates => abi-gen-templates}/README.md (100%) rename packages/{contract-templates => abi-gen-templates}/contract.handlebars (100%) rename packages/{contract-templates => abi-gen-templates}/package.json (87%) rename packages/{contract-templates => abi-gen-templates}/partials/call.handlebars (100%) rename packages/{contract-templates => abi-gen-templates}/partials/callAsync.handlebars (100%) rename packages/{contract-templates => abi-gen-templates}/partials/event.handlebars (100%) rename packages/{contract-templates => abi-gen-templates}/partials/params.handlebars (100%) rename packages/{contract-templates => abi-gen-templates}/partials/return_type.handlebars (100%) rename packages/{contract-templates => abi-gen-templates}/partials/tx.handlebars (100%) rename packages/{contract-templates => abi-gen-templates}/partials/typed_params.handlebars (100%) diff --git a/packages/contract-templates/CHANGELOG.json b/packages/abi-gen-templates/CHANGELOG.json similarity index 100% rename from packages/contract-templates/CHANGELOG.json rename to packages/abi-gen-templates/CHANGELOG.json diff --git a/packages/contract-templates/README.md b/packages/abi-gen-templates/README.md similarity index 100% rename from packages/contract-templates/README.md rename to packages/abi-gen-templates/README.md diff --git a/packages/contract-templates/contract.handlebars b/packages/abi-gen-templates/contract.handlebars similarity index 100% rename from packages/contract-templates/contract.handlebars rename to packages/abi-gen-templates/contract.handlebars diff --git a/packages/contract-templates/package.json b/packages/abi-gen-templates/package.json similarity index 87% rename from packages/contract-templates/package.json rename to packages/abi-gen-templates/package.json index f79ae89311..e06be6127c 100644 --- a/packages/contract-templates/package.json +++ b/packages/abi-gen-templates/package.json @@ -1,5 +1,5 @@ { - "name": "@0x/contract-templates", + "name": "@0x/abi-gen-templates", "version": "1.0.0", "engines": { "node": ">=6.12" @@ -13,7 +13,7 @@ "bugs": { "url": "https://github.com/0xProject/0x-monorepo/issues" }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/contract-templates/README.md", + "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-templates/README.md", "publishConfig": { "access": "public" } diff --git a/packages/contract-templates/partials/call.handlebars b/packages/abi-gen-templates/partials/call.handlebars similarity index 100% rename from packages/contract-templates/partials/call.handlebars rename to packages/abi-gen-templates/partials/call.handlebars diff --git a/packages/contract-templates/partials/callAsync.handlebars b/packages/abi-gen-templates/partials/callAsync.handlebars similarity index 100% rename from packages/contract-templates/partials/callAsync.handlebars rename to packages/abi-gen-templates/partials/callAsync.handlebars diff --git a/packages/contract-templates/partials/event.handlebars b/packages/abi-gen-templates/partials/event.handlebars similarity index 100% rename from packages/contract-templates/partials/event.handlebars rename to packages/abi-gen-templates/partials/event.handlebars diff --git a/packages/contract-templates/partials/params.handlebars b/packages/abi-gen-templates/partials/params.handlebars similarity index 100% rename from packages/contract-templates/partials/params.handlebars rename to packages/abi-gen-templates/partials/params.handlebars diff --git a/packages/contract-templates/partials/return_type.handlebars b/packages/abi-gen-templates/partials/return_type.handlebars similarity index 100% rename from packages/contract-templates/partials/return_type.handlebars rename to packages/abi-gen-templates/partials/return_type.handlebars diff --git a/packages/contract-templates/partials/tx.handlebars b/packages/abi-gen-templates/partials/tx.handlebars similarity index 100% rename from packages/contract-templates/partials/tx.handlebars rename to packages/abi-gen-templates/partials/tx.handlebars diff --git a/packages/contract-templates/partials/typed_params.handlebars b/packages/abi-gen-templates/partials/typed_params.handlebars similarity index 100% rename from packages/contract-templates/partials/typed_params.handlebars rename to packages/abi-gen-templates/partials/typed_params.handlebars diff --git a/packages/abi-gen-wrappers/package.json b/packages/abi-gen-wrappers/package.json index df1c484ec2..1b7015d552 100644 --- a/packages/abi-gen-wrappers/package.json +++ b/packages/abi-gen-wrappers/package.json @@ -15,7 +15,7 @@ "lint": "tslint --format stylish --project .", "pre_build": "yarn generate_contract_wrappers", "clean": "shx rm -rf lib wrappers", - "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/contract-templates/contract.handlebars --partials '../../node_modules/@0x/contract-templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers" + "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-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" @@ -31,7 +31,7 @@ "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md", "devDependencies": { "@0x/abi-gen": "^1.0.17", - "@0x/contract-templates": "^1.0.0", + "@0x/abi-gen-templates": "^1.0.0", "@0x/tslint-config": "^1.0.10", "@0x/types": "^1.3.0", "@0x/utils": "^2.0.6", diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 4fb0838f40..25445c4f87 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -22,7 +22,7 @@ "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", "clean": "shx rm -rf lib generated-artifacts generated-wrappers", - "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/contract-templates/contract.handlebars --partials '../../node_modules/@0x/contract-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers", + "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/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", "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index 8081c03c93..332fbb4662 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -18,7 +18,7 @@ "test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov", "test:profile": "SOLIDITY_PROFILER=true run-s build run_mocha profiler:report:html", "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --bail --exit --timeout 10000", - "generate_contract_wrappers": "abi-gen --abis 'artifacts/Metacoin.json' --template ../../node_modules/@0x/contract-templates/contract.handlebars --partials '../../node_modules/@0x/contract-templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers", + "generate_contract_wrappers": "abi-gen --abis 'artifacts/Metacoin.json' --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers", "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", "profiler:report:html": "istanbul report html && open coverage/index.html", @@ -30,7 +30,7 @@ "license": "Apache-2.0", "dependencies": { "@0x/abi-gen": "^1.0.17", - "@0x/contract-templates": "^1.0.0", + "@0x/abi-gen-templates": "^1.0.0", "@0x/base-contract": "^3.0.7", "@0x/sol-cov": "^2.1.13", "@0x/subproviders": "^2.1.5",