Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yargs12 #386

Merged
merged 4 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/aragon-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"truffle-hdwallet-provider": "^1.0.2",
"truffle-hdwallet-provider-privkey": "^0.3.0",
"web3": "1.0.0-beta.34",
"yargs": "^10.1.0"
"yargs": "12.0.5"
},
"devDependencies": {
"@aragon/apps-finance": "^2.0.0",
Expand Down
11 changes: 4 additions & 7 deletions packages/aragon-cli/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ const MIDDLEWARES = [
]

// Set up commands
const cmd = require('yargs').commandDir('./commands', {
visit: cmd => {
// Add middlewares
cmd.middlewares = MIDDLEWARES
return cmd
},
}) // .strict()
const cmd = require('yargs').commandDir('./commands')
// .strict()

cmd.middleware(MIDDLEWARES)

cmd.alias('h', 'help')
cmd.alias('v', 'version')
Expand Down
25 changes: 3 additions & 22 deletions packages/aragon-cli/src/commands/apm.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
const {
manifestMiddleware,
moduleMiddleware,
environmentMiddleware,
} = require('../middleware')

const MIDDLEWARES = [
manifestMiddleware,
moduleMiddleware,
environmentMiddleware,
]

exports.command = 'apm <command>'

exports.describe = 'Publish and manage your APM package'

exports.aliases = ['package']

exports.builder = function(yargs) {
const cmd = yargs.commandDir('apm_cmds', {
visit: cmd => {
// Add middlewares
cmd.middlewares = MIDDLEWARES
return cmd
},
})
cmd.demandCommand(1, 'You need to specify a command')

return cmd
return yargs
.commandDir('apm_cmds')
.demandCommand(1, 'You need to specify a command')
}
25 changes: 3 additions & 22 deletions packages/aragon-cli/src/commands/dao.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
const daoArg = require('./dao_cmds/utils/daoArg')
const {
manifestMiddleware,
moduleMiddleware,
environmentMiddleware,
} = require('../middleware')

const MIDDLEWARES = [
manifestMiddleware,
moduleMiddleware,
environmentMiddleware,
]

exports.command = 'dao <command>'

Expand All @@ -19,15 +8,7 @@ exports.builder = function(yargs) {
if (process.argv[3] !== 'new' && process.argv[3] !== 'act') {
yargs = daoArg(yargs)
}

const cmd = yargs.commandDir('dao_cmds', {
visit: cmd => {
// Add middlewares
cmd.middlewares = MIDDLEWARES
return cmd
},
})
cmd.demandCommand(1, 'You need to specify a command')

return cmd
return yargs
.commandDir('dao_cmds')
.demandCommand(1, 'You need to specify a command')
}
19 changes: 1 addition & 18 deletions packages/aragon-cli/src/commands/dao_cmds/acl.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
const viewCommand = require('./acl_cmds/view')

const {
manifestMiddleware,
moduleMiddleware,
environmentMiddleware,
} = require('../../middleware')

const MIDDLEWARES = [
manifestMiddleware,
moduleMiddleware,
environmentMiddleware,
]

exports.command = 'acl <dao>'

exports.describe = 'Shortcut for aragon dao acl view <dao>'

exports.builder = function(yargs) {
return yargs.commandDir('acl_cmds', {
visit: cmd => {
cmd.middlewares = MIDDLEWARES
return cmd
},
})
return yargs.commandDir('acl_cmds')
}

exports.handler = viewCommand.handler
19 changes: 1 addition & 18 deletions packages/aragon-cli/src/commands/dao_cmds/token.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
const {
manifestMiddleware,
moduleMiddleware,
environmentMiddleware,
} = require('../../middleware')

const MIDDLEWARES = [
manifestMiddleware,
moduleMiddleware,
environmentMiddleware,
]

exports.command = 'token <command>'

exports.describe = 'Create and interact with MiniMe tokens'

exports.builder = function(yargs) {
return yargs
.commandDir('token_cmds', {
visit: cmd => {
cmd.middlewares = MIDDLEWARES
return cmd
},
})
.commandDir('token_cmds')
.demandCommand(1, 'You need to specify a command')
}
4 changes: 2 additions & 2 deletions packages/create-aragon-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-aragon-app",
"version": "1.0.6",
"version": "1.0.8",
"description": "Aragon command-line tool to create aragon apps",
"main": "dist/cli.js",
"bin": {
Expand All @@ -13,7 +13,7 @@
},
"repository": {
"type": "git",
"url": ""
"url": "https://github.com/aragon/aragon-cli/tree/master/packages/create-aragon-app"
},
"keywords": [
"create-aragon-app",
Expand Down