Skip to content

Commit

Permalink
fix(cli): adapt to commander@8+ API
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Nov 11, 2021
1 parent d9007d7 commit 232730f
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import program from 'commander'
import { program } from 'commander'
import inquirer from 'inquirer'

inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'))
Expand Down
10 changes: 7 additions & 3 deletions packages/cli/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'cross-fetch/polyfill'
import program from 'commander'
import { program } from 'commander'
import { SecretBox } from '@veramo/kms-local'
import { getAgent, getConfig } from './setup'
const fs = require('fs')
Expand Down Expand Up @@ -77,9 +77,13 @@ config
)
} else {
if (typeof agent[options.method] !== 'function') {
console.error(`The agent was created using the config, but the 'agent.${options.method}()' method is not available. Make sure the plugin that implements that method is installed.`)
console.error(
`The agent was created using the config, but the 'agent.${options.method}()' method is not available. Make sure the plugin that implements that method is installed.`,
)
} else {
console.log(`Your Veramo configuration seems fine. An agent can be created and the 'agent.${options.method}()' method can be called on it.`)
console.log(
`Your Veramo configuration seems fine. An agent can be created and the 'agent.${options.method}()' method can be called on it.`,
)
}
}
})
2 changes: 1 addition & 1 deletion packages/cli/src/credential.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { W3CCredential } from '@veramo/core'
import { getAgent } from './setup'
import program from 'commander'
import { program } from 'commander'
import inquirer from 'inquirer'
import qrcode from 'qrcode-terminal'

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ApiParameterListMixin,
ApiReturnTypeMixin,
} from '@microsoft/api-extractor-model'
import program from 'commander'
import { program } from 'commander'
import { writeFileSync } from 'fs'
import { OpenAPIV3 } from 'openapi-types'
import { resolve } from 'path'
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/did.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IDIDManagerCreateArgs } from '@veramo/core'
import { getAgent } from './setup'
import inquirer from 'inquirer'
import program from 'commander'
import { program } from 'commander'
import { printTable } from 'console-table-printer'

const did = program.command('did').description('Decentralized identifiers')
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/discover.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getAgent } from './setup'
import program from 'commander'
import { program } from 'commander'
import { printTable } from 'console-table-printer'

const discover = program.command('discover').description('Discovery')
Expand Down
4 changes: 1 addition & 3 deletions packages/cli/src/execute.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { input } from 'blessed'
import program from 'commander'
import { program } from 'commander'
import inquirer from 'inquirer'
import jsonpointer from 'jsonpointer'
import { getAgent } from './setup'
const fs = require('fs')
const OasResolver = require('oas-resolver')
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/explore/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getAgent } from '../setup'
import program from 'commander'
import { program } from 'commander'
import { renderMainScreen } from './main'

program
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/explore/presentations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import blessed, { Widgets } from 'blessed'
import { VerifiablePresentation } from '@veramo/core'
import { UniqueVerifiablePresentation } from '@veramo/data-store'
import { shortDate, shortDid } from './utils'
import { ConfiguredAgent } from '../setup'
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/message.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getAgent } from './setup'
import program from 'commander'
import { program } from 'commander'
const fs = require('fs')

const message = program.command('message').description('Messages')
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/presentation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { W3CCredential } from '@veramo/core'
import { getAgent } from './setup'
import program from 'commander'
import { program } from 'commander'
import inquirer from 'inquirer'
import qrcode from 'qrcode-terminal'

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/sdr.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ICredentialRequestInput } from '@veramo/selective-disclosure'
import { getAgent } from './setup'
import program from 'commander'
import { program } from 'commander'
import inquirer from 'inquirer'
import qrcode from 'qrcode-terminal'
import { shortDate, shortDid } from './explore/utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import express from 'express'
import program from 'commander'
import { program } from 'commander'
import { getConfig } from './setup'
import { createObjects } from './lib/objectCreator'

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import program from 'commander'
import { program } from 'commander'

const { version } = require('../package.json')

Expand Down

0 comments on commit 232730f

Please sign in to comment.