Skip to content

Commit

Permalink
fix: forwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jan 18, 2023
1 parent 62ea0ec commit dac9e15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"bugs": "https://github.com/oclif/oclif/issues",
"dependencies": {
"@oclif/core": "^1.24.1",
"@oclif/core": "^1.24.2",
"@oclif/plugin-help": "^5.1.19",
"@oclif/plugin-not-found": "^2.3.7",
"@oclif/plugin-warn-if-update-available": "^2.0.14",
Expand Down Expand Up @@ -140,4 +140,4 @@
"registry": "https://registry.npmjs.org"
},
"types": "lib/index.d.ts"
}
}
5 changes: 3 additions & 2 deletions src/commands/readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {URL} from 'url'

import {castArray, compact, sortBy, template, uniqBy} from '../util'
import {HelpCompatibilityWrapper} from '../help-compatibility'
import {ArgInput} from '@oclif/core/lib/interfaces'

const normalize = require('normalize-package-data')
const columns = Number.parseInt(process.env.COLUMNS!, 10) || 120
Expand Down Expand Up @@ -256,7 +255,9 @@ USAGE
}

// v2 commands have args as an object, so we need to normalize it to an array for forwards compatibility
const normalized = (Array.isArray(command.args) ? command.args ?? [] : Object.values(command.args ?? {})) as ArgInput
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const normalized = Array.isArray(command.args) ? command.args ?? [] : Object.entries(command.args ?? {}).map(([name, arg]) => ({...arg, name}))
const id = toConfiguredId(command.id, config)
const defaultUsage = () => {
return compact([
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,10 @@
widest-line "^3.1.0"
wrap-ansi "^7.0.0"

"@oclif/core@^1.24.1":
version "1.24.1"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.24.1.tgz#b10324fc8dfbe70539a4479509b25a9dd867aed3"
integrity sha512-CQFCsj9fUALfTNGXR9qaP3yXiF9TuL6GKph1NwXMe2yzpAE4Zz8X8uFpi916rE3oAHEPX6bR9fhdUiBGgDBuGw==
"@oclif/core@^1.24.2":
version "1.24.2"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.24.2.tgz#1d2e4b8b27db7e98b0c1d7b367934196a2f2c202"
integrity sha512-0wfAa6HG4sJ4j5c4/GV4BWZwALtJyw2ZO6titnrWKcowxU1BWd8mBM45ilTPnDhClMowz7+8EtK4kqUGc1rNwA==
dependencies:
"@oclif/linewrap" "^1.0.0"
"@oclif/screen" "^3.0.4"
Expand Down

0 comments on commit dac9e15

Please sign in to comment.