From 25e31cbab61cd032415da949c6455653373361e3 Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Wed, 12 Jun 2019 01:48:03 -0300 Subject: [PATCH 01/12] Update yargs and update scripts --- .travis.yml | 4 ++-- package.json | 17 +++++++++-------- scripts/start-ganache-bg | 16 +++++++++++----- src/cli.js | 10 +++++++++- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index b993178..b36bbc6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ node_js: - '8' install: - npm install - - travis_wait 60 npm run get-repos - - npm run start-ganache-bg && npm run gen + - travis_wait 60 npm run gen + - npm run start-ganache-bg && npm run deploy before_script: - npm prune before_deploy: echo 'Starting publish to NPM' diff --git a/package.json b/package.json index 220c45b..11311a5 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,16 @@ "aragen": "./src/cli.js" }, "scripts": { - "start": "npm run start-ganache-bg && npm run get-repos && npm run gen", - "start:local": "npm run start-ganache-bg && npm run link-repos && npm run gen", - "gen": "scripts/deploy-base && scripts/publish-apps && scripts/publish-templates", + "start": "npm run start-ganache-bg && npm run gen && npm run deploy", + "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", "start-ganache": "scripts/start-ganache", "start-ganache-bg": "scripts/start-ganache-bg", - "get-repos": "scripts/get-repos", + "gen": "scripts/get-repos", "link-repos": "scripts/link-repos", - "deploy-base": "scripts/deploy-base" + "depoly": "scripts/deploy-base && scripts/publish-apps && scripts/publish-templates", + "depoly-base": "scripts/deploy-base", + "publish-apps": "scripts/publish-apps", + "publish-templates": "scripts/publish-templates" }, "files": [ "index.js", @@ -44,7 +46,7 @@ "ncp": "^2.0.0", "rimraf": "^2.6.2", "web3": "1.0.0-beta.35", - "yargs": "^12.0.0" + "yargs": "^13.2.4" }, "devDependencies": { "@aragon/cli": "^5.0.0", @@ -62,8 +64,7 @@ "ganache-core", "ganache-cli", "truffle", - "web3", - "yargs" + "web3" ] } } diff --git a/scripts/start-ganache-bg b/scripts/start-ganache-bg index 4d33e18..2805744 100755 --- a/scripts/start-ganache-bg +++ b/scripts/start-ganache-bg @@ -1,9 +1,15 @@ #!/bin/bash -set +e; -kill -9 $(lsof -t -i:8545); -set -e; +ganache_port=8545 +ganache_running() { + nc -z localhost "$ganache_port" &> /dev/null +} -echo "Starting ganache in the background"; +if ganache_running; then + echo "Killing ganache instance at port $ganache_port" + kill -9 $(lsof -t -i:$ganache_port); +fi -nohup npm run start-ganache & +printf "Starting ganache in the background\n\n"; + +nohup npm run start-ganache & \ No newline at end of file diff --git a/src/cli.js b/src/cli.js index 849a6c9..19cc95e 100755 --- a/src/cli.js +++ b/src/cli.js @@ -3,7 +3,15 @@ require('@babel/polyfill') const ConsoleReporter = require('./reporters/ConsoleReporter') // Set up commands -const cmd = require('yargs').commandDir('./commands') +const cmd = require('yargs') + .parserConfiguration({ + 'short-option-groups': true, + 'camel-case-expansion': true, + 'dot-notation': true, + 'parse-numbers': false, + 'boolean-negation': true, + }) + .commandDir('./commands') cmd.alias('h', 'help') cmd.alias('v', 'version') From 0e584d15197924005307f368c8a0ac54f366c1b2 Mon Sep 17 00:00:00 2001 From: Gabriel Garcia Date: Wed, 12 Jun 2019 02:03:55 -0300 Subject: [PATCH 02/12] Update start script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 11311a5..46464e8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "aragen": "./src/cli.js" }, "scripts": { - "start": "npm run start-ganache-bg && npm run gen && npm run deploy", + "start": "npm run start-ganache-bg && npm run deploy", "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", "start-ganache": "scripts/start-ganache", "start-ganache-bg": "scripts/start-ganache-bg", From a87a3dbf030c16c1d3971d719ae5a0aa7309d40b Mon Sep 17 00:00:00 2001 From: Gabriel Garcia Date: Wed, 12 Jun 2019 04:29:42 -0300 Subject: [PATCH 03/12] Fix typo --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 46464e8..6fd9703 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "start-ganache-bg": "scripts/start-ganache-bg", "gen": "scripts/get-repos", "link-repos": "scripts/link-repos", - "depoly": "scripts/deploy-base && scripts/publish-apps && scripts/publish-templates", - "depoly-base": "scripts/deploy-base", + "deploy": "scripts/deploy-base && scripts/publish-apps && scripts/publish-templates", + "deploy-base": "scripts/deploy-base", "publish-apps": "scripts/publish-apps", "publish-templates": "scripts/publish-templates" }, From 6f19f858a140ec5cd1ce5e25f96bf63e0263683c Mon Sep 17 00:00:00 2001 From: Gabriel Garcia Date: Mon, 24 Jun 2019 11:11:46 -0300 Subject: [PATCH 04/12] Update yargs parser --- src/cli.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cli.js b/src/cli.js index 19cc95e..341643d 100755 --- a/src/cli.js +++ b/src/cli.js @@ -4,12 +4,9 @@ const ConsoleReporter = require('./reporters/ConsoleReporter') // Set up commands const cmd = require('yargs') + .strict() .parserConfiguration({ - 'short-option-groups': true, - 'camel-case-expansion': true, - 'dot-notation': true, 'parse-numbers': false, - 'boolean-negation': true, }) .commandDir('./commands') From f9fef40f87a30bafbc8a2e5ac318f434f76b1652 Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Sat, 13 Jul 2019 15:49:44 -0300 Subject: [PATCH 05/12] Update scripts & dependencies --- .gitignore | 12 +++++++--- .travis.yml | 5 ++--- package.json | 13 ++++++----- scripts/deploy-base | 6 ++--- .../apm-open.js} | 2 +- scripts/{deploy-apm.js => deploy/apm.js} | 4 ++-- .../beta-aragonid.js} | 22 +++++++++++++------ .../daofactory.js} | 0 scripts/{ => deploy}/helpers/get-accounts.js | 0 .../test-ens.js} | 0 scripts/get-repos | 5 +++++ scripts/link-repos | 1 + scripts/publish-templates | 4 ++-- src/cli.js | 3 ++- 14 files changed, 49 insertions(+), 28 deletions(-) rename scripts/{deploy-apm-open.js => deploy/apm-open.js} (98%) rename scripts/{deploy-apm.js => deploy/apm.js} (97%) rename scripts/{deploy-beta-aragonid.js => deploy/beta-aragonid.js} (80%) rename scripts/{deploy-daofactory.js => deploy/daofactory.js} (100%) rename scripts/{ => deploy}/helpers/get-accounts.js (100%) rename scripts/{deploy-test-ens.js => deploy/test-ens.js} (100%) diff --git a/.gitignore b/.gitignore index 73b9748..0baadfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,14 @@ +# Dependencies node_modules -repos -aragon-ganache + nohup.out -ipfs-cache package-lock.json + +# build +repos build flattened_contracts + +# snapshot +aragon-ganache +ipfs-cache \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index b36bbc6..fa32516 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,8 @@ notifications: node_js: - '8' install: - - npm install - - travis_wait 60 npm run gen - - npm run start-ganache-bg && npm run deploy + - travis_wait 60 npm install + - npm run start before_script: - npm prune before_deploy: echo 'Starting publish to NPM' diff --git a/package.json b/package.json index 6fd9703..5540719 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,14 @@ "aragen": "./src/cli.js" }, "scripts": { + "postinstall": "npm run gen", "start": "npm run start-ganache-bg && npm run deploy", "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", + "deploy": "npm run deploy-base && npm run publish-apps && npm run publish-templates", "start-ganache": "scripts/start-ganache", "start-ganache-bg": "scripts/start-ganache-bg", "gen": "scripts/get-repos", "link-repos": "scripts/link-repos", - "deploy": "scripts/deploy-base && scripts/publish-apps && scripts/publish-templates", "deploy-base": "scripts/deploy-base", "publish-apps": "scripts/publish-apps", "publish-templates": "scripts/publish-templates" @@ -38,22 +39,22 @@ }, "homepage": "https://github.com/aragon/aragen#readme", "dependencies": { - "@babel/polyfill": "^7.0.0", "chalk": "^2.1.0", + "core-js": "^3.1.4", "figures": "^3.0.0", - "ganache-core": "2.5.3", + "ganache-core": "^2.5.7", "listr": "^0.14.3", "ncp": "^2.0.0", "rimraf": "^2.6.2", - "web3": "1.0.0-beta.35", + "web3": "1.0.0-beta.37", "yargs": "^13.2.4" }, "devDependencies": { - "@aragon/cli": "^5.0.0", + "@aragon/cli": "^6.0.0", "@aragon/id": "^2.0.0", "@aragon/os": "^4.2.0", "eth-ens-namehash": "^2.0.8", - "ganache-cli": "~6.2.0", + "ganache-cli": "^6.4.2", "truffle": "4.1.14" }, "publishConfig": { diff --git a/scripts/deploy-base b/scripts/deploy-base index 4523343..bf5905d 100755 --- a/scripts/deploy-base +++ b/scripts/deploy-base @@ -8,7 +8,7 @@ sleep 2; # let the people read echo "Deploying ENS instance" npx truffle compile; -DEPLOYED_ENS=$(npx truffle exec --network rpc scripts/deploy-test-ens.js | tail -n 1) +DEPLOYED_ENS=$(npx truffle exec --network rpc scripts/deploy/test-ens.js | tail -n 1) if [ "${ENS}" = "${DEPLOYED_ENS}" ]; then echo "ENS deployed $DEPLOYED_ENS" else @@ -19,7 +19,7 @@ else fi echo "Deploying APM registry to aragonpm.eth and open.aragonpm.eth" -npx truffle exec --network rpc scripts/deploy-apm-open.js +npx truffle exec --network rpc scripts/deploy/apm-open.js echo "Deploying aragonID registry to aragonpm.eth" -npx truffle exec --network rpc scripts/deploy-beta-aragonid.js; +npx truffle exec --network rpc scripts/deploy/beta-aragonid.js; diff --git a/scripts/deploy-apm-open.js b/scripts/deploy/apm-open.js similarity index 98% rename from scripts/deploy-apm-open.js rename to scripts/deploy/apm-open.js index 175decf..c019d2d 100644 --- a/scripts/deploy-apm-open.js +++ b/scripts/deploy/apm-open.js @@ -1,7 +1,7 @@ const namehash = require('eth-ens-namehash').hash const keccak256 = require('js-sha3').keccak_256 -const deployAPM = require('./deploy-apm') +const deployAPM = require('./apm') const globalArtifacts = this.artifacts // Not injected unless called directly via truffle const globalWeb3 = this.web3 // Not injected unless called directly via truffle diff --git a/scripts/deploy-apm.js b/scripts/deploy/apm.js similarity index 97% rename from scripts/deploy-apm.js rename to scripts/deploy/apm.js index 1a5f4b9..a10bf17 100644 --- a/scripts/deploy-apm.js +++ b/scripts/deploy/apm.js @@ -1,8 +1,8 @@ const namehash = require('eth-ens-namehash').hash const keccak256 = require('js-sha3').keccak_256 -const deployENS = require('./deploy-test-ens') -const deployDaoFactory = require('./deploy-daofactory') +const deployENS = require('./test-ens') +const deployDaoFactory = require('./daofactory') const logDeploy = require('@aragon/os/scripts/helpers/deploy-logger') const getAccounts = require('./helpers/get-accounts') diff --git a/scripts/deploy-beta-aragonid.js b/scripts/deploy/beta-aragonid.js similarity index 80% rename from scripts/deploy-beta-aragonid.js rename to scripts/deploy/beta-aragonid.js index bd45984..855edc5 100644 --- a/scripts/deploy-beta-aragonid.js +++ b/scripts/deploy/beta-aragonid.js @@ -9,7 +9,7 @@ const defaultOwner = process.env.OWNER const defaultENSAddress = process.env.ENS const tld = namehash('eth') -const label = '0x'+keccak256('aragonid') +const label = '0x' + keccak256('aragonid') const node = namehash('aragonid.eth') module.exports = async ( @@ -19,11 +19,13 @@ module.exports = async ( web3 = globalWeb3, ensAddress = defaultENSAddress, owner = defaultOwner, - verbose = true + verbose = true, } = {} ) => { const log = (...args) => { - if (verbose) { console.log(...args) } + if (verbose) { + console.log(...args) + } } const accounts = await getAccounts(web3) @@ -32,14 +34,20 @@ module.exports = async ( const FIFSResolvingRegistrar = artifacts.require('FIFSResolvingRegistrar') const ENS = artifacts.require('AbstractENS') - const publicResolver = await ENS.at(ensAddress).resolver(namehash('resolver.eth')) - const aragonID = await FIFSResolvingRegistrar.new(ensAddress, publicResolver, node) + const publicResolver = await ENS.at(ensAddress).resolver( + namehash('resolver.eth') + ) + const aragonID = await FIFSResolvingRegistrar.new( + ensAddress, + publicResolver, + node + ) await logDeploy(aragonID, { verbose }) log('assigning ENS name to AragonID') const ens = ENS.at(ensAddress) - if (await ens.owner(node) === accounts[0]) { + if ((await ens.owner(node)) === accounts[0]) { log('Transferring name ownership from deployer to AragonID') await ens.setOwner(node, aragonID.address) } else { @@ -57,7 +65,7 @@ module.exports = async ( if (owner) { log('assigning owner name') - await aragonID.register('0x'+keccak256('owner'), owner) + await aragonID.register('0x' + keccak256('owner'), owner) } log('===========') diff --git a/scripts/deploy-daofactory.js b/scripts/deploy/daofactory.js similarity index 100% rename from scripts/deploy-daofactory.js rename to scripts/deploy/daofactory.js diff --git a/scripts/helpers/get-accounts.js b/scripts/deploy/helpers/get-accounts.js similarity index 100% rename from scripts/helpers/get-accounts.js rename to scripts/deploy/helpers/get-accounts.js diff --git a/scripts/deploy-test-ens.js b/scripts/deploy/test-ens.js similarity index 100% rename from scripts/deploy-test-ens.js rename to scripts/deploy/test-ens.js diff --git a/scripts/get-repos b/scripts/get-repos index fe957bd..41291ea 100755 --- a/scripts/get-repos +++ b/scripts/get-repos @@ -17,3 +17,8 @@ echo "Fetching dao-kits and installing dependencies (this may also take a while git clone https://github.com/aragon/dao-kits.git -b master; cd dao-kits; npm i; + +# echo "Fetching aragon client and installing dependencies" +# git clone https://github.com/aragon/aragon.git -b master; +# cd aragon; +# npm i; \ No newline at end of file diff --git a/scripts/link-repos b/scripts/link-repos index 766d855..5a3a78a 100755 --- a/scripts/link-repos +++ b/scripts/link-repos @@ -10,3 +10,4 @@ cd repos echo "Linking to local repos" ln -s ../../aragon-apps aragon-apps ln -s ../../dao-kits dao-kits +# ln -s ../../aragon aragon diff --git a/scripts/publish-templates b/scripts/publish-templates index 490443a..b95c234 100755 --- a/scripts/publish-templates +++ b/scripts/publish-templates @@ -8,6 +8,6 @@ source scripts/set-env; set -e; cd repos/dao-kits; -LERNA_EXEC="npx lerna exec --scope=@aragon/kits-bare --scope=@aragon/kits-democracy --scope=@aragon/kits-multisig --scope=@aragon/kits-survey --concurrency=1 --stream" +LERNA_EXEC="npx lerna exec --scope=@aragon/templates-bare --scope=@aragon/templates-democracy --scope=@aragon/templates-multisig --scope=@aragon/templates-trust --concurrency=1 --stream" -$LERNA_EXEC -- "npm run publish:rpc -- --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME" \ No newline at end of file +$LERNA_EXEC -- "aragon apm publish 1.0.0 $(npm run deploy:rpc | tail -n 1) --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME" \ No newline at end of file diff --git a/src/cli.js b/src/cli.js index 341643d..ad6a37d 100755 --- a/src/cli.js +++ b/src/cli.js @@ -1,5 +1,6 @@ #!/usr/bin/env node -require('@babel/polyfill') +import 'core-js/stable' +import 'regenerator-runtime/runtime' const ConsoleReporter = require('./reporters/ConsoleReporter') // Set up commands From d0a315e4761aeecbcb677f0faef29fa2dd435b5b Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Sat, 13 Jul 2019 16:32:48 -0300 Subject: [PATCH 06/12] Publish client --- package.json | 7 +++---- scripts/get-repos | 9 +++++---- scripts/link-repos | 2 +- scripts/publish-apps | 4 ++-- scripts/publish-client | 9 +++++++++ scripts/publish-templates | 2 +- 6 files changed, 21 insertions(+), 12 deletions(-) create mode 100755 scripts/publish-client diff --git a/package.json b/package.json index 5540719..ca741ea 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,15 @@ "postinstall": "npm run gen", "start": "npm run start-ganache-bg && npm run deploy", "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", - "deploy": "npm run deploy-base && npm run publish-apps && npm run publish-templates", + "deploy": "npm run deploy-base && npm run publish-apps && npm run publish-templates && npm run publish-client", "start-ganache": "scripts/start-ganache", "start-ganache-bg": "scripts/start-ganache-bg", "gen": "scripts/get-repos", "link-repos": "scripts/link-repos", "deploy-base": "scripts/deploy-base", "publish-apps": "scripts/publish-apps", - "publish-templates": "scripts/publish-templates" + "publish-templates": "scripts/publish-templates", + "publish-client": "scripts/publish-client" }, "files": [ "index.js", @@ -62,8 +63,6 @@ }, "greenkeeper": { "ignore": [ - "ganache-core", - "ganache-cli", "truffle", "web3" ] diff --git a/scripts/get-repos b/scripts/get-repos index 41291ea..f7b9dfa 100755 --- a/scripts/get-repos +++ b/scripts/get-repos @@ -17,8 +17,9 @@ echo "Fetching dao-kits and installing dependencies (this may also take a while git clone https://github.com/aragon/dao-kits.git -b master; cd dao-kits; npm i; +cd ..; -# echo "Fetching aragon client and installing dependencies" -# git clone https://github.com/aragon/aragon.git -b master; -# cd aragon; -# npm i; \ No newline at end of file +echo "Fetching aragon client and installing dependencies" +git clone https://github.com/aragon/aragon.git -b master; +cd aragon; +npm i; \ No newline at end of file diff --git a/scripts/link-repos b/scripts/link-repos index 5a3a78a..e8e95a4 100755 --- a/scripts/link-repos +++ b/scripts/link-repos @@ -10,4 +10,4 @@ cd repos echo "Linking to local repos" ln -s ../../aragon-apps aragon-apps ln -s ../../dao-kits dao-kits -# ln -s ../../aragon aragon +ln -s ../../aragon aragon diff --git a/scripts/publish-apps b/scripts/publish-apps index 0aa27ea..4f1f0fc 100755 --- a/scripts/publish-apps +++ b/scripts/publish-apps @@ -13,5 +13,5 @@ cd repos/aragon-apps; LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-finance --scope=@aragon/apps-voting --scope=@aragon/apps-token-manager --scope=@aragon/apps-survey --concurrency=1 --stream" LERNA_EXEC_APPS_WITHOUT_UI="npx lerna exec --scope=@aragon/apps-vault --scope=@aragon/apps-agent --concurrency=1 --stream" -$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files app/build --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME" -$LERNA_EXEC_APPS_WITHOUT_UI -- "aragon apm publish 1.0.0 --files public --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME" +$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files app/build --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" +$LERNA_EXEC_APPS_WITHOUT_UI -- "aragon apm publish 1.0.0 --files public --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" diff --git a/scripts/publish-client b/scripts/publish-client new file mode 100755 index 0000000..5c30af5 --- /dev/null +++ b/scripts/publish-client @@ -0,0 +1,9 @@ +#!/bin/bash + +DIR=$(pwd) +IPFS_CACHE=$DIR/ipfs-cache + +set -e; +cd repos/aragon; + +npm run publish:major -- --publish-dir $IPFS_CACHE/@aragon/aragon --skip-confirmation --no-propagate-content --no-build; diff --git a/scripts/publish-templates b/scripts/publish-templates index b95c234..97f8751 100755 --- a/scripts/publish-templates +++ b/scripts/publish-templates @@ -10,4 +10,4 @@ cd repos/dao-kits; LERNA_EXEC="npx lerna exec --scope=@aragon/templates-bare --scope=@aragon/templates-democracy --scope=@aragon/templates-multisig --scope=@aragon/templates-trust --concurrency=1 --stream" -$LERNA_EXEC -- "aragon apm publish 1.0.0 $(npm run deploy:rpc | tail -n 1) --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME" \ No newline at end of file +$LERNA_EXEC -- "aragon apm publish 1.0.0 $(npm run deploy:rpc | tail -n 1) --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" \ No newline at end of file From 72eb16a01d3cf813fedab1c1e65548a578e15ea6 Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Sat, 20 Jul 2019 12:27:59 -0300 Subject: [PATCH 07/12] Refactor to use cli-utils --- index.js | 2 +- package.json | 2 +- src/cli.js | 3 +- src/commands/devchain.js | 22 +++++++++----- src/helpers/listr-options.js | 19 ------------- src/reporters/ConsoleReporter.js | 49 -------------------------------- src/reporters/ListrRenderer.js | 9 ------ 7 files changed, 19 insertions(+), 87 deletions(-) delete mode 100644 src/helpers/listr-options.js delete mode 100644 src/reporters/ConsoleReporter.js delete mode 100644 src/reporters/ListrRenderer.js diff --git a/index.js b/index.js index f376be0..9de6593 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ module.exports = { // ENS is deterministically deployed to this address ens: '0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1', - ConsoleReporter: require('./src/reporters/ConsoleReporter'), + ConsoleReporter: require('@aragon/cli-utils/src/reporters/ConsoleReporter'), commands: { devchain: require('./src/commands/devchain'), }, diff --git a/package.json b/package.json index ca741ea..d23310c 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,9 @@ }, "homepage": "https://github.com/aragon/aragen#readme", "dependencies": { + "@aragon/cli-utils": "^0.0.1", "chalk": "^2.1.0", "core-js": "^3.1.4", - "figures": "^3.0.0", "ganache-core": "^2.5.7", "listr": "^0.14.3", "ncp": "^2.0.0", diff --git a/src/cli.js b/src/cli.js index ad6a37d..35e4034 100755 --- a/src/cli.js +++ b/src/cli.js @@ -1,7 +1,7 @@ #!/usr/bin/env node import 'core-js/stable' import 'regenerator-runtime/runtime' -const ConsoleReporter = require('./reporters/ConsoleReporter') +const ConsoleReporter = require('@aragon/cli-utils/src/reporters/ConsoleReporter') // Set up commands const cmd = require('yargs') @@ -9,6 +9,7 @@ const cmd = require('yargs') .parserConfiguration({ 'parse-numbers': false, }) + .usage(`Usage: aragen [options]`) .commandDir('./commands') cmd.alias('h', 'help') diff --git a/src/commands/devchain.js b/src/commands/devchain.js index d6fba4e..2c2950b 100644 --- a/src/commands/devchain.js +++ b/src/commands/devchain.js @@ -9,7 +9,7 @@ const rimraf = require('rimraf') const mkdirp = require('mkdirp') const chalk = require('chalk') const fs = require('fs') -const listrOpts = require('../helpers/listr-options') +const listrOpts = require('@aragon/cli-utils/src/helpers/listr-options') const pjson = require('../../package.json') const { BLOCK_GAS_LIMIT, MNEMONIC } = require('../helpers/ganache-vars') @@ -85,7 +85,9 @@ exports.task = async function({ server.listen(port, err => { if (err) return reject(err) - task.title = `Local chain started at port ${port}` + task.title = `Local chain started at port ${chalk.blue( + port.toString + )}` resolve() }) }) @@ -122,7 +124,7 @@ exports.printAccounts = (reporter, privateKeys) => { const formattedAccounts = privateKeys.map( ({ address, key }, i) => chalk.bold( - `Address #${i + 1}: ${address} ${ + `Address #${i + 1}: ${chalk.green(address.toString)} ${ i === 0 ? firstAccountComment : '' }\nPrivate key: ` ) + key @@ -136,7 +138,9 @@ exports.printAccounts = (reporter, privateKeys) => { exports.printMnemonic = (reporter, mnemonic) => { reporter.info( - `The accounts were generated from the following mnemonic phrase:\n${mnemonic}\n` + `The accounts were generated from the following mnemonic phrase:\n${chalk.blue( + mnemonic.toString + )}\n` ) } @@ -144,7 +148,7 @@ exports.printResetNotice = (reporter, reset) => { if (reset) { reporter.warning(`The devchain was reset, some steps need to be done to prevent issues: - Reset the application cache in Aragon Core by going to Settings > Troubleshooting. - - If using Metamask: switch to a different network, and then switch back to the 'Private Network' (this will clear the nonce cache and prevent errors when sending transactions) + - If using Metamask: switch to a different network, and then switch back to the 'Private Network' (this will clear the nonce cache and prevent errors when sending transactions) `) } } @@ -173,8 +177,12 @@ exports.handler = async ({ exports.printResetNotice(reporter, reset) reporter.info( - `ENS instance deployed at 0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1\n` + `ENS instance deployed at ${chalk.blue( + '0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1' + )}\n` ) - reporter.info(`Devchain running: ${chalk.bold('http://localhost:' + port)}.`) + reporter.info( + `Devchain running: ${chalk.blue(chalk.bold('http://localhost:' + port))}.` + ) } diff --git a/src/helpers/listr-options.js b/src/helpers/listr-options.js deleted file mode 100644 index f5311c8..0000000 --- a/src/helpers/listr-options.js +++ /dev/null @@ -1,19 +0,0 @@ -const ListrRenderer = require('../reporters/ListrRenderer') - -/** - * https://github.com/SamVerschueren/listr#options - * https://github.com/SamVerschueren/listr-update-renderer#options - * https://github.com/SamVerschueren/listr-verbose-renderer#options - * - * @param {boolean} silent Option silent - * @param {boolean} debug Option debug - * @returns {Object} listr options object - */ -function listrOpts(silent, debug) { - return { - renderer: ListrRenderer(silent, debug), - dateFormat: false, - } -} - -module.exports = listrOpts diff --git a/src/reporters/ConsoleReporter.js b/src/reporters/ConsoleReporter.js deleted file mode 100644 index 9b85c45..0000000 --- a/src/reporters/ConsoleReporter.js +++ /dev/null @@ -1,49 +0,0 @@ -const chalk = require('chalk') -const figures = require('figures') - -module.exports = class ConsoleReporter { - constructor(opts = { silent: false }) { - this.silent = opts.silent - } - - message(category = 'info', message) { - if (this.silent) return - - const color = { - debug: 'magenta', - info: 'blue', - warning: 'yellow', - error: 'red', - success: 'green', - }[category] - const symbol = { - debug: figures.pointer, - info: figures.info, - warning: figures.warning, - error: figures.cross, - success: figures.tick, - }[category] - const icon = chalk[color](symbol) - console.log(` ${icon} ${message}`) - } - - debug(message) { - if (global.DEBUG_MODE) this.message('debug', message) - } - - info(message) { - this.message('info', message) - } - - warning(message) { - this.message('warning', message) - } - - error(message) { - this.message('error', message) - } - - success(message) { - this.message('success', message) - } -} diff --git a/src/reporters/ListrRenderer.js b/src/reporters/ListrRenderer.js deleted file mode 100644 index 2bef647..0000000 --- a/src/reporters/ListrRenderer.js +++ /dev/null @@ -1,9 +0,0 @@ -const VerboseRenderer = require('listr-verbose-renderer') -const SilentRenderer = require('listr-silent-renderer') -const UpdateRenderer = require('listr-update-renderer') - -module.exports = function(silent, debug) { - if (debug) return VerboseRenderer - if (silent) return SilentRenderer - return UpdateRenderer -} From b84f5aa2313bdbe58038bf413bdde96f21e0a6e9 Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Sun, 21 Jul 2019 02:30:49 -0300 Subject: [PATCH 08/12] Update dependencies, change kits for templates and update client build script --- index.js | 1 - package.json | 4 ++-- scripts/deploy/apm.js | 2 +- scripts/deploy/beta-aragonid.js | 2 +- scripts/deploy/helpers/get-accounts.js | 10 -------- scripts/deploy/test-ens.js | 2 +- scripts/get-repos | 6 ++--- scripts/link-repos | 2 +- scripts/publish-client | 2 +- scripts/publish-templates | 2 +- src/cli.js | 3 +-- src/commands/devchain.js | 32 +++++++++++--------------- 12 files changed, 26 insertions(+), 42 deletions(-) delete mode 100644 scripts/deploy/helpers/get-accounts.js diff --git a/index.js b/index.js index 9de6593..cf1e891 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,6 @@ module.exports = { // ENS is deterministically deployed to this address ens: '0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1', - ConsoleReporter: require('@aragon/cli-utils/src/reporters/ConsoleReporter'), commands: { devchain: require('./src/commands/devchain'), }, diff --git a/package.json b/package.json index d23310c..4f02e7e 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "aragen": "./src/cli.js" }, "scripts": { - "postinstall": "npm run gen", "start": "npm run start-ganache-bg && npm run deploy", "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", "deploy": "npm run deploy-base && npm run publish-apps && npm run publish-templates && npm run publish-client", @@ -40,7 +39,8 @@ }, "homepage": "https://github.com/aragon/aragen#readme", "dependencies": { - "@aragon/cli-utils": "^0.0.1", + "@aragon/cli-utils": "^0.0.2", + "@babel/polyfill": "^7.0.0", "chalk": "^2.1.0", "core-js": "^3.1.4", "ganache-core": "^2.5.7", diff --git a/scripts/deploy/apm.js b/scripts/deploy/apm.js index a10bf17..f9dec8f 100644 --- a/scripts/deploy/apm.js +++ b/scripts/deploy/apm.js @@ -4,7 +4,7 @@ const keccak256 = require('js-sha3').keccak_256 const deployENS = require('./test-ens') const deployDaoFactory = require('./daofactory') const logDeploy = require('@aragon/os/scripts/helpers/deploy-logger') -const getAccounts = require('./helpers/get-accounts') +const getAccounts = require('@aragon/os/scripts/helpers/get-accounts') const globalArtifacts = this.artifacts // Not injected unless called directly via truffle const globalWeb3 = this.web3 // Not injected unless called directly via truffle diff --git a/scripts/deploy/beta-aragonid.js b/scripts/deploy/beta-aragonid.js index 855edc5..e2d1b0e 100644 --- a/scripts/deploy/beta-aragonid.js +++ b/scripts/deploy/beta-aragonid.js @@ -1,7 +1,7 @@ const namehash = require('eth-ens-namehash').hash const keccak256 = require('js-sha3').keccak_256 const logDeploy = require('@aragon/os/scripts/helpers/deploy-logger') -const getAccounts = require('./helpers/get-accounts') +const getAccounts = require('@aragon/os/scripts/helpers/get-accounts') const globalArtifacts = this.artifacts // Not injected unless called directly via truffle const globalWeb3 = this.web3 // Not injected unless called directly via truffle diff --git a/scripts/deploy/helpers/get-accounts.js b/scripts/deploy/helpers/get-accounts.js deleted file mode 100644 index faed9b8..0000000 --- a/scripts/deploy/helpers/get-accounts.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = web3 => ( - new Promise((resolve, reject) => { - web3.eth.getAccounts((err, accounts) => { - if (err) { - return reject(err) - } - resolve(accounts) - }) - }) -) \ No newline at end of file diff --git a/scripts/deploy/test-ens.js b/scripts/deploy/test-ens.js index ca32ba9..164298d 100644 --- a/scripts/deploy/test-ens.js +++ b/scripts/deploy/test-ens.js @@ -1,5 +1,5 @@ const logDeploy = require('@aragon/os/scripts/helpers/deploy-logger') -const getAccounts = require('./helpers/get-accounts') +const getAccounts = require('@aragon/os/scripts/helpers/get-accounts') const globalArtifacts = this.artifacts // Not injected unless called directly via truffle const globalWeb3 = this.web3 // Not injected unless called directly via truffle diff --git a/scripts/get-repos b/scripts/get-repos index f7b9dfa..5f0140b 100755 --- a/scripts/get-repos +++ b/scripts/get-repos @@ -13,9 +13,9 @@ cd aragon-apps; INSTALL_FRONTEND=true npm i; cd ..; -echo "Fetching dao-kits and installing dependencies (this may also take a while 😉)" -git clone https://github.com/aragon/dao-kits.git -b master; -cd dao-kits; +echo "Fetching dao-templates and installing dependencies (this may also take a while 😉)" +git clone https://github.com/aragon/dao-templates.git -b next; +cd dao-templates; npm i; cd ..; diff --git a/scripts/link-repos b/scripts/link-repos index e8e95a4..212eeae 100755 --- a/scripts/link-repos +++ b/scripts/link-repos @@ -9,5 +9,5 @@ cd repos echo "Linking to local repos" ln -s ../../aragon-apps aragon-apps -ln -s ../../dao-kits dao-kits +ln -s ../../dao-templates dao-templates ln -s ../../aragon aragon diff --git a/scripts/publish-client b/scripts/publish-client index 5c30af5..6761083 100755 --- a/scripts/publish-client +++ b/scripts/publish-client @@ -6,4 +6,4 @@ IPFS_CACHE=$DIR/ipfs-cache set -e; cd repos/aragon; -npm run publish:major -- --publish-dir $IPFS_CACHE/@aragon/aragon --skip-confirmation --no-propagate-content --no-build; +npm run build:local; diff --git a/scripts/publish-templates b/scripts/publish-templates index 97f8751..18a588d 100755 --- a/scripts/publish-templates +++ b/scripts/publish-templates @@ -6,7 +6,7 @@ IPFS_CACHE=$DIR/ipfs-cache source scripts/set-env; set -e; -cd repos/dao-kits; +cd repos/dao-templates; LERNA_EXEC="npx lerna exec --scope=@aragon/templates-bare --scope=@aragon/templates-democracy --scope=@aragon/templates-multisig --scope=@aragon/templates-trust --concurrency=1 --stream" diff --git a/src/cli.js b/src/cli.js index 35e4034..1a9d49a 100755 --- a/src/cli.js +++ b/src/cli.js @@ -1,6 +1,5 @@ #!/usr/bin/env node -import 'core-js/stable' -import 'regenerator-runtime/runtime' +require('@babel/polyfill') const ConsoleReporter = require('@aragon/cli-utils/src/reporters/ConsoleReporter') // Set up commands diff --git a/src/commands/devchain.js b/src/commands/devchain.js index 2c2950b..a860b8b 100644 --- a/src/commands/devchain.js +++ b/src/commands/devchain.js @@ -85,9 +85,7 @@ exports.task = async function({ server.listen(port, err => { if (err) return reject(err) - task.title = `Local chain started at port ${chalk.blue( - port.toString - )}` + task.title = `Local chain started at port ${chalk.blue(port)}\n` resolve() }) }) @@ -119,19 +117,19 @@ exports.task = async function({ exports.printAccounts = (reporter, privateKeys) => { const firstAccountComment = - '(this account is used to deploy DAOs, it has more permissions)' + '(account used to deploy DAOs, has more permissions)' const formattedAccounts = privateKeys.map( ({ address, key }, i) => - chalk.bold( - `Address #${i + 1}: ${chalk.green(address.toString)} ${ - i === 0 ? firstAccountComment : '' - }\nPrivate key: ` - ) + key + `Address #${i + 1}: ${chalk.green(address)} ${ + i === 0 ? firstAccountComment : '' + }\nPrivate key: ` + + chalk.blue(key) + + '\n' ) reporter.info(`Here are some Ethereum accounts you can use. - The first one will be used for all the actions the CLI performs. + The first one will be used for all the actions the aragonCLI performs. You can use your favorite Ethereum provider or wallet to import their private keys. \n${formattedAccounts.join('\n')}`) } @@ -139,7 +137,7 @@ exports.printAccounts = (reporter, privateKeys) => { exports.printMnemonic = (reporter, mnemonic) => { reporter.info( `The accounts were generated from the following mnemonic phrase:\n${chalk.blue( - mnemonic.toString + mnemonic )}\n` ) } @@ -147,7 +145,7 @@ exports.printMnemonic = (reporter, mnemonic) => { exports.printResetNotice = (reporter, reset) => { if (reset) { reporter.warning(`The devchain was reset, some steps need to be done to prevent issues: - - Reset the application cache in Aragon Core by going to Settings > Troubleshooting. + - Reset the application cache in Aragon Client by going to Settings -> Troubleshooting. - If using Metamask: switch to a different network, and then switch back to the 'Private Network' (this will clear the nonce cache and prevent errors when sending transactions) `) } @@ -177,12 +175,10 @@ exports.handler = async ({ exports.printResetNotice(reporter, reset) reporter.info( - `ENS instance deployed at ${chalk.blue( - '0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1' - )}\n` + 'ENS instance deployed at', + chalk.green('0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1'), + '\n' ) - reporter.info( - `Devchain running: ${chalk.blue(chalk.bold('http://localhost:' + port))}.` - ) + reporter.info(`Devchain running: ${chalk.blue('http://localhost:' + port)}.`) } From 602d214ec944d7800ca839e39bc7f510af002683 Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Sun, 21 Jul 2019 02:35:03 -0300 Subject: [PATCH 09/12] Include postinstall script and remove greenkeeper --- package.json | 8 +------- readme.md | 11 ++++++++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 4f02e7e..5d286e7 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "aragen": "./src/cli.js" }, "scripts": { + "postinstall": "npm run gen", "start": "npm run start-ganache-bg && npm run deploy", "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", "deploy": "npm run deploy-base && npm run publish-apps && npm run publish-templates && npm run publish-client", @@ -42,7 +43,6 @@ "@aragon/cli-utils": "^0.0.2", "@babel/polyfill": "^7.0.0", "chalk": "^2.1.0", - "core-js": "^3.1.4", "ganache-core": "^2.5.7", "listr": "^0.14.3", "ncp": "^2.0.0", @@ -60,11 +60,5 @@ }, "publishConfig": { "access": "public" - }, - "greenkeeper": { - "ignore": [ - "truffle", - "web3" - ] } } diff --git a/readme.md b/readme.md index 1c02c8d..8b64f67 100644 --- a/readme.md +++ b/readme.md @@ -1,12 +1,14 @@ -# AraGen [![Build Status](https://travis-ci.org/aragon/aragen.svg?branch=master)](https://travis-ci.org/aragon/aragen) [![npm](https://img.shields.io/npm/v/@aragon/aragen.svg?style=for-the-badge)](https://www.npmjs.com/package/@aragon/aragen) [![Greenkeeper badge](https://badges.greenkeeper.io/aragon/aragen.svg)](https://greenkeeper.io/) +# AraGen [![Build Status](https://travis-ci.org/aragon/aragen.svg?branch=master)](https://travis-ci.org/aragon/aragen) [![npm](https://img.shields.io/npm/v/@aragon/aragen.svg?style=for-the-badge)](https://www.npmjs.com/package/@aragon/aragen) Generate an Aragon environment ### Requirements + - `npm` - `git` ### How to + ``` npm i npm start @@ -14,7 +16,7 @@ npm start Yes, you are done. Happy hacking 🔥🦅! -If you happen to stop ganache, just: +If you happen to stop ganache, just: ``` npm run start-ganache @@ -42,7 +44,10 @@ npx aragen devchain If you wish to access from code, for example to run ganache-core directly: ```js -const aragonSnapshot = path.resolve(require.resolve('@aragon/aragen'), '../aragon-ganache') +const aragonSnapshot = path.resolve( + require.resolve('@aragon/aragen'), + '../aragon-ganache' +) ``` ### CI From 4a4b5ed505c2c345ef14713f17dc8d4de212c522 Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Sun, 21 Jul 2019 18:40:38 -0300 Subject: [PATCH 10/12] Add planning suite repo, update scripts --- scripts/get-repos | 6 ++++++ scripts/{publish-apps => publish-aragon-apps} | 2 +- scripts/publish-client | 2 ++ scripts/publish-planning-suite | 15 +++++++++++++++ scripts/publish-templates | 2 +- 5 files changed, 25 insertions(+), 2 deletions(-) rename scripts/{publish-apps => publish-aragon-apps} (85%) create mode 100755 scripts/publish-planning-suite diff --git a/scripts/get-repos b/scripts/get-repos index 5f0140b..210e2bf 100755 --- a/scripts/get-repos +++ b/scripts/get-repos @@ -13,6 +13,12 @@ cd aragon-apps; INSTALL_FRONTEND=true npm i; cd ..; +echo "Fetching planning-suite and installing dependencies (this may take a while 😉)" +git clone https://github.com/AutarkLabs/planning-suite.git -b dev; +cd planning-suite; +npm i; +cd ..; + echo "Fetching dao-templates and installing dependencies (this may also take a while 😉)" git clone https://github.com/aragon/dao-templates.git -b next; cd dao-templates; diff --git a/scripts/publish-apps b/scripts/publish-aragon-apps similarity index 85% rename from scripts/publish-apps rename to scripts/publish-aragon-apps index 4f1f0fc..437a332 100755 --- a/scripts/publish-apps +++ b/scripts/publish-aragon-apps @@ -14,4 +14,4 @@ LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-finance --scope=@aragon/app LERNA_EXEC_APPS_WITHOUT_UI="npx lerna exec --scope=@aragon/apps-vault --scope=@aragon/apps-agent --concurrency=1 --stream" $LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files app/build --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" -$LERNA_EXEC_APPS_WITHOUT_UI -- "aragon apm publish 1.0.0 --files public --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" +$LERNA_EXEC_APPS_WITHOUT_UI -- "aragon apm publish 1.0.0 --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" diff --git a/scripts/publish-client b/scripts/publish-client index 6761083..3cbb3ca 100755 --- a/scripts/publish-client +++ b/scripts/publish-client @@ -7,3 +7,5 @@ set -e; cd repos/aragon; npm run build:local; + +aragon apm publish 1.0.0 --files build --publish-dir $IPFS_CACHE/@aragon/aragon --skip-confirmation --no-propagate-content; diff --git a/scripts/publish-planning-suite b/scripts/publish-planning-suite new file mode 100755 index 0000000..24476c0 --- /dev/null +++ b/scripts/publish-planning-suite @@ -0,0 +1,15 @@ +#!/bin/bash + +DIR=$(pwd) +IPFS_CACHE=$DIR/ipfs-cache + +rm -rf $IPFS_CACHE; +mkdir $IPFS_CACHE; + +set -e; + +cd repos/planning-suite; + +LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-address-book --scope=@aragon/apps-allocations --scope=@aragon/apps-dot-voting --scope=@aragon/apps-projects --scope=@aragon/apps-rewards --concurrency=1 --stream" + +$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files dist/ --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" diff --git a/scripts/publish-templates b/scripts/publish-templates index 18a588d..e771ac1 100755 --- a/scripts/publish-templates +++ b/scripts/publish-templates @@ -8,6 +8,6 @@ source scripts/set-env; set -e; cd repos/dao-templates; -LERNA_EXEC="npx lerna exec --scope=@aragon/templates-bare --scope=@aragon/templates-democracy --scope=@aragon/templates-multisig --scope=@aragon/templates-trust --concurrency=1 --stream" +LERNA_EXEC="npx lerna exec --scope=@aragon/templates-bare --scope=@aragon/templates-company --scope=@aragon/templates-company-board --scope=@aragon/templates-democracy --scope=@aragon/templates-membership --scope=@aragon/templates-multisig --scope=@aragon/templates-reputation --scope=@aragon/templates-trust --concurrency=1 --stream" $LERNA_EXEC -- "aragon apm publish 1.0.0 $(npm run deploy:rpc | tail -n 1) --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" \ No newline at end of file From 832cf43a9e6dd1037c8c3ae2bddfd896f6add598 Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Wed, 24 Jul 2019 16:33:13 -0300 Subject: [PATCH 11/12] Update publish scripts --- package.json | 9 +++++---- scripts/link-repos | 1 + scripts/publish-client | 5 ++++- scripts/{publish-aragon-apps => publish-core-apps} | 5 +---- .../{publish-planning-suite => publish-open-enterprise} | 3 --- 5 files changed, 11 insertions(+), 12 deletions(-) rename scripts/{publish-aragon-apps => publish-core-apps} (91%) rename scripts/{publish-planning-suite => publish-open-enterprise} (91%) diff --git a/package.json b/package.json index 5d286e7..ee900d0 100644 --- a/package.json +++ b/package.json @@ -10,15 +10,16 @@ "postinstall": "npm run gen", "start": "npm run start-ganache-bg && npm run deploy", "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", - "deploy": "npm run deploy-base && npm run publish-apps && npm run publish-templates && npm run publish-client", + "deploy": "npm run deploy-base && npm run publish-client && npm run publish-core-apps && npm run publish-open-enterprise && npm run publish-templates", "start-ganache": "scripts/start-ganache", "start-ganache-bg": "scripts/start-ganache-bg", "gen": "scripts/get-repos", "link-repos": "scripts/link-repos", "deploy-base": "scripts/deploy-base", - "publish-apps": "scripts/publish-apps", - "publish-templates": "scripts/publish-templates", - "publish-client": "scripts/publish-client" + "publish-client": "scripts/publish-client", + "publish-core-apps": "scripts/publish-core-apps", + "publish-open-enterprise": "scripts/publish-open-enterprise", + "publish-templates": "scripts/publish-templates" }, "files": [ "index.js", diff --git a/scripts/link-repos b/scripts/link-repos index 212eeae..3c4e95c 100755 --- a/scripts/link-repos +++ b/scripts/link-repos @@ -9,5 +9,6 @@ cd repos echo "Linking to local repos" ln -s ../../aragon-apps aragon-apps +ln -s ../../planning-suite planning-suite ln -s ../../dao-templates dao-templates ln -s ../../aragon aragon diff --git a/scripts/publish-client b/scripts/publish-client index 3cbb3ca..83abfb7 100755 --- a/scripts/publish-client +++ b/scripts/publish-client @@ -3,9 +3,12 @@ DIR=$(pwd) IPFS_CACHE=$DIR/ipfs-cache +rm -rf $IPFS_CACHE; +mkdir $IPFS_CACHE; + set -e; cd repos/aragon; npm run build:local; -aragon apm publish 1.0.0 --files build --publish-dir $IPFS_CACHE/@aragon/aragon --skip-confirmation --no-propagate-content; +aragon apm publish 1.0.0 --only-content --files build/ --publish-dir $IPFS_CACHE/@aragon/aragon --skip-confirmation --no-propagate-content --no-build; diff --git a/scripts/publish-aragon-apps b/scripts/publish-core-apps similarity index 91% rename from scripts/publish-aragon-apps rename to scripts/publish-core-apps index 437a332..cb92da8 100755 --- a/scripts/publish-aragon-apps +++ b/scripts/publish-core-apps @@ -1,10 +1,7 @@ #!/bin/bash DIR=$(pwd) -IPFS_CACHE=$DIR/ipfs-cache - -rm -rf $IPFS_CACHE; -mkdir $IPFS_CACHE; +IPFS_CACHE=$DIR/ipfs-cachapp/buil set -e; diff --git a/scripts/publish-planning-suite b/scripts/publish-open-enterprise similarity index 91% rename from scripts/publish-planning-suite rename to scripts/publish-open-enterprise index 24476c0..65bd363 100755 --- a/scripts/publish-planning-suite +++ b/scripts/publish-open-enterprise @@ -3,9 +3,6 @@ DIR=$(pwd) IPFS_CACHE=$DIR/ipfs-cache -rm -rf $IPFS_CACHE; -mkdir $IPFS_CACHE; - set -e; cd repos/planning-suite; From a1aac38396860e70240f3a1e8847ceae188935c8 Mon Sep 17 00:00:00 2001 From: 0xGabi Date: Sun, 28 Jul 2019 01:18:09 -0300 Subject: [PATCH 12/12] Update dependencies & iterate on publish scripts --- package.json | 6 +++--- scripts/publish-client | 2 +- scripts/publish-core-apps | 7 ++++--- scripts/publish-open-enterprise | 2 +- scripts/publish-templates | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ee900d0..1ddbd05 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "postinstall": "npm run gen", "start": "npm run start-ganache-bg && npm run deploy", "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", - "deploy": "npm run deploy-base && npm run publish-client && npm run publish-core-apps && npm run publish-open-enterprise && npm run publish-templates", + "deploy": "npm run deploy-base && npm run publish-client && npm run publish-core-apps && npm run publish-templates", "start-ganache": "scripts/start-ganache", "start-ganache-bg": "scripts/start-ganache-bg", "gen": "scripts/get-repos", @@ -41,14 +41,14 @@ }, "homepage": "https://github.com/aragon/aragen#readme", "dependencies": { - "@aragon/cli-utils": "^0.0.2", + "@aragon/cli-utils": "^0.0.3", "@babel/polyfill": "^7.0.0", "chalk": "^2.1.0", "ganache-core": "^2.5.7", "listr": "^0.14.3", "ncp": "^2.0.0", "rimraf": "^2.6.2", - "web3": "1.0.0-beta.37", + "web3": "^1.2.0", "yargs": "^13.2.4" }, "devDependencies": { diff --git a/scripts/publish-client b/scripts/publish-client index 83abfb7..330893c 100755 --- a/scripts/publish-client +++ b/scripts/publish-client @@ -11,4 +11,4 @@ cd repos/aragon; npm run build:local; -aragon apm publish 1.0.0 --only-content --files build/ --publish-dir $IPFS_CACHE/@aragon/aragon --skip-confirmation --no-propagate-content --no-build; +aragon apm publish 1.0.0 --only-content --files build --publish-dir $IPFS_CACHE/@aragon/aragon --skip-confirmation --no-propagate-content --no-build; diff --git a/scripts/publish-core-apps b/scripts/publish-core-apps index cb92da8..850cfef 100755 --- a/scripts/publish-core-apps +++ b/scripts/publish-core-apps @@ -1,14 +1,15 @@ #!/bin/bash DIR=$(pwd) -IPFS_CACHE=$DIR/ipfs-cachapp/buil +IPFS_CACHE=$DIR/ipfs-cache set -e; cd repos/aragon-apps; -LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-finance --scope=@aragon/apps-voting --scope=@aragon/apps-token-manager --scope=@aragon/apps-survey --concurrency=1 --stream" +LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-finance --scope=@aragon/apps-voting --scope=@aragon/apps-token-manager --scope=@aragon/apps-survey --scope=@aragon/future-apps-payroll --concurrency=1 --stream" LERNA_EXEC_APPS_WITHOUT_UI="npx lerna exec --scope=@aragon/apps-vault --scope=@aragon/apps-agent --concurrency=1 --stream" + $LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files app/build --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" -$LERNA_EXEC_APPS_WITHOUT_UI -- "aragon apm publish 1.0.0 --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" +$LERNA_EXEC_APPS_WITHOUT_UI -- "aragon apm publish 1.0.0 --files public --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" diff --git a/scripts/publish-open-enterprise b/scripts/publish-open-enterprise index 65bd363..3461aac 100755 --- a/scripts/publish-open-enterprise +++ b/scripts/publish-open-enterprise @@ -9,4 +9,4 @@ cd repos/planning-suite; LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-address-book --scope=@aragon/apps-allocations --scope=@aragon/apps-dot-voting --scope=@aragon/apps-projects --scope=@aragon/apps-rewards --concurrency=1 --stream" -$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files dist/ --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" +$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files dist --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" diff --git a/scripts/publish-templates b/scripts/publish-templates index e771ac1..dd93fff 100755 --- a/scripts/publish-templates +++ b/scripts/publish-templates @@ -8,6 +8,6 @@ source scripts/set-env; set -e; cd repos/dao-templates; -LERNA_EXEC="npx lerna exec --scope=@aragon/templates-bare --scope=@aragon/templates-company --scope=@aragon/templates-company-board --scope=@aragon/templates-democracy --scope=@aragon/templates-membership --scope=@aragon/templates-multisig --scope=@aragon/templates-reputation --scope=@aragon/templates-trust --concurrency=1 --stream" +LERNA_EXEC="npx lerna exec --scope=@aragon/templates-bare --scope=@aragon/templates-company --scope=@aragon/templates-company-board --scope=@aragon/templates-membership --scope=@aragon/templates-reputation --scope=@aragon/templates-trust --concurrency=1 --stream" -$LERNA_EXEC -- "aragon apm publish 1.0.0 $(npm run deploy:rpc | tail -n 1) --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" \ No newline at end of file +$LERNA_EXEC -- "npm run publish:rpc -- --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" \ No newline at end of file