From 9fc5c509b6475b19c1f49fdf31cf7d5ed3fcc16a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 17:06:02 +0100 Subject: [PATCH] fix(deps): update dependency commander to v8 (#587) * fix(deps): update dependency commander to v8 * fix(cli): adapt to commander@8+ API Co-authored-by: Renovate Bot Co-authored-by: Mircea Nistor --- packages/cli/package.json | 2 +- packages/cli/src/cli.ts | 2 +- packages/cli/src/config.ts | 10 +++++++--- packages/cli/src/credential.ts | 2 +- packages/cli/src/dev.ts | 2 +- packages/cli/src/did.ts | 2 +- packages/cli/src/discover.ts | 2 +- packages/cli/src/execute.ts | 4 +--- packages/cli/src/explore/index.ts | 2 +- packages/cli/src/explore/presentations.ts | 1 - packages/cli/src/message.ts | 2 +- packages/cli/src/presentation.ts | 2 +- packages/cli/src/sdr.ts | 2 +- packages/cli/src/server.ts | 2 +- packages/cli/src/version.ts | 2 +- yarn.lock | 5 ----- 16 files changed, 20 insertions(+), 24 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 499d62724..aeec9197d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -37,7 +37,7 @@ "@veramo/selective-disclosure": "^3.0.0", "@veramo/url-handler": "^3.0.0", "blessed": "^0.1.81", - "commander": "^7.0.0", + "commander": "^8.0.0", "console-table-printer": "^2.8.2", "cors": "^2.8.5", "cross-fetch": "^3.1.4", diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 049848c7a..2659f19c0 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -1,4 +1,4 @@ -import program from 'commander' +import { program } from 'commander' import inquirer from 'inquirer' inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt')) diff --git a/packages/cli/src/config.ts b/packages/cli/src/config.ts index 0cbc15a94..7cb7427c1 100644 --- a/packages/cli/src/config.ts +++ b/packages/cli/src/config.ts @@ -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') @@ -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.`, + ) } } }) diff --git a/packages/cli/src/credential.ts b/packages/cli/src/credential.ts index c50e90697..591824775 100644 --- a/packages/cli/src/credential.ts +++ b/packages/cli/src/credential.ts @@ -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' diff --git a/packages/cli/src/dev.ts b/packages/cli/src/dev.ts index f753a38e2..264aac4f0 100644 --- a/packages/cli/src/dev.ts +++ b/packages/cli/src/dev.ts @@ -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' diff --git a/packages/cli/src/did.ts b/packages/cli/src/did.ts index 789f6748b..7b91dde4f 100644 --- a/packages/cli/src/did.ts +++ b/packages/cli/src/did.ts @@ -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') diff --git a/packages/cli/src/discover.ts b/packages/cli/src/discover.ts index e1362a9d2..546e525ec 100644 --- a/packages/cli/src/discover.ts +++ b/packages/cli/src/discover.ts @@ -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') diff --git a/packages/cli/src/execute.ts b/packages/cli/src/execute.ts index 235b568ff..d2af65de0 100644 --- a/packages/cli/src/execute.ts +++ b/packages/cli/src/execute.ts @@ -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') diff --git a/packages/cli/src/explore/index.ts b/packages/cli/src/explore/index.ts index e3894fdef..d9cbeec7a 100644 --- a/packages/cli/src/explore/index.ts +++ b/packages/cli/src/explore/index.ts @@ -1,5 +1,5 @@ import { getAgent } from '../setup' -import program from 'commander' +import { program } from 'commander' import { renderMainScreen } from './main' program diff --git a/packages/cli/src/explore/presentations.ts b/packages/cli/src/explore/presentations.ts index e1c63e81a..b7768ca96 100644 --- a/packages/cli/src/explore/presentations.ts +++ b/packages/cli/src/explore/presentations.ts @@ -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' diff --git a/packages/cli/src/message.ts b/packages/cli/src/message.ts index b88c8f66d..074191d9d 100644 --- a/packages/cli/src/message.ts +++ b/packages/cli/src/message.ts @@ -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') diff --git a/packages/cli/src/presentation.ts b/packages/cli/src/presentation.ts index 4e4d289b1..d96cbfe50 100644 --- a/packages/cli/src/presentation.ts +++ b/packages/cli/src/presentation.ts @@ -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' diff --git a/packages/cli/src/sdr.ts b/packages/cli/src/sdr.ts index 736caf610..a3867454a 100644 --- a/packages/cli/src/sdr.ts +++ b/packages/cli/src/sdr.ts @@ -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' diff --git a/packages/cli/src/server.ts b/packages/cli/src/server.ts index 9a53ca790..5a6d485c1 100644 --- a/packages/cli/src/server.ts +++ b/packages/cli/src/server.ts @@ -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' diff --git a/packages/cli/src/version.ts b/packages/cli/src/version.ts index c27363eea..467023901 100644 --- a/packages/cli/src/version.ts +++ b/packages/cli/src/version.ts @@ -1,4 +1,4 @@ -import program from 'commander' +import { program } from 'commander' const { version } = require('../package.json') diff --git a/yarn.lock b/yarn.lock index 310c62483..698b17be1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3885,11 +3885,6 @@ commander@^2.7.1: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^7.0.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - commander@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.0.0.tgz#1da2139548caef59bd23e66d18908dfb54b02258"