@oclif/plugin-update
Advanced tools
Comparing version 4.5.10 to 4.6.0
@@ -16,2 +16,3 @@ import { Command, Interfaces } from '@oclif/core'; | ||
interactive: Interfaces.BooleanFlag<boolean>; | ||
verbose: Interfaces.BooleanFlag<boolean>; | ||
version: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>; | ||
@@ -18,0 +19,0 @@ }; |
import select from '@inquirer/select'; | ||
import { Args, Command, Flags, ux } from '@oclif/core'; | ||
import { printTable } from '@oclif/table'; | ||
import { got } from 'got'; | ||
import { basename } from 'node:path'; | ||
import { sort } from 'semver'; | ||
import TtyTable from 'tty-table'; | ||
import { Updater } from '../update.js'; | ||
@@ -47,2 +47,7 @@ export default class UpdateCommand extends Command { | ||
}), | ||
verbose: Flags.boolean({ | ||
char: 'b', | ||
dependsOn: ['available'], | ||
description: 'Show more details about the available versions.', | ||
}), | ||
version: Flags.string({ | ||
@@ -59,20 +64,27 @@ char: 'v', | ||
const { distTags, index, localVersions } = await lookupVersions(updater, this.config); | ||
const headers = [ | ||
{ align: 'left', value: 'Location' }, | ||
{ align: 'left', value: 'Version' }, | ||
]; | ||
if (distTags) { | ||
headers.push({ align: 'left', value: 'Channel' }); | ||
} | ||
// eslint-disable-next-line new-cap | ||
const t = TtyTable(headers, sort(Object.keys(index)) | ||
.reverse() | ||
.map((version) => { | ||
const data = Object.keys(index).map((version) => { | ||
const location = localVersions.find((l) => basename(l).startsWith(version)) || index[version]; | ||
if (distTags) { | ||
return [location, version, distTags[version] ?? '']; | ||
} | ||
return [location, version]; | ||
}), { compact: true }); | ||
ux.stdout(t.render()); | ||
const channel = distTags[version] === 'latest' | ||
? 'stable' | ||
: distTags[version] === 'latest-rc' | ||
? 'stable-rc' | ||
: distTags[version]; | ||
return { | ||
channel, | ||
downloaded: location.includes('http') ? '' : 'true', | ||
location, | ||
version: this.config.version === version ? `${ux.colorize('yellowBright', version)} (current)` : version, | ||
}; | ||
}); | ||
printTable({ | ||
borderStyle: 'vertical-with-outline', | ||
columns: flags.verbose | ||
? ['version', 'channel', 'downloaded', 'location'] | ||
: ['version', 'channel', 'downloaded'], | ||
data, | ||
headerOptions: { | ||
formatter: 'capitalCase', | ||
}, | ||
overflow: 'wrap', | ||
}); | ||
return; | ||
@@ -79,0 +91,0 @@ } |
@@ -168,3 +168,3 @@ import { Config, ux } from '@oclif/core'; | ||
async refreshConfig(version) { | ||
this.config = (await Config.load({ root: join(this.clientRoot, version) })); | ||
this.config = await Config.load({ root: join(this.clientRoot, version) }); | ||
} | ||
@@ -171,0 +171,0 @@ // removes any unused CLIs |
@@ -67,2 +67,12 @@ { | ||
}, | ||
"verbose": { | ||
"char": "b", | ||
"dependsOn": [ | ||
"available" | ||
], | ||
"description": "Show more details about the available versions.", | ||
"name": "verbose", | ||
"allowNo": false, | ||
"type": "boolean" | ||
}, | ||
"version": { | ||
@@ -100,3 +110,3 @@ "char": "v", | ||
}, | ||
"version": "4.5.10" | ||
"version": "4.6.0" | ||
} |
{ | ||
"name": "@oclif/plugin-update", | ||
"version": "4.5.10", | ||
"version": "4.6.0", | ||
"author": "Salesforce", | ||
@@ -9,2 +9,3 @@ "bugs": "https://github.com/oclif/plugin-update/issues", | ||
"@oclif/core": "^4", | ||
"@oclif/table": "^0.1.12", | ||
"ansis": "^3.3.2", | ||
@@ -16,4 +17,3 @@ "debug": "^4.3.7", | ||
"semver": "^7.6.3", | ||
"tar-fs": "^2.1.1", | ||
"tty-table": "^4.2.3" | ||
"tar-fs": "^2.1.1" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
@@ -29,6 +29,7 @@ # @oclif/plugin-update | ||
USAGE | ||
$ oclif-example update [CHANNEL] [--force | | [-a | -v <value> | -i]] | ||
$ oclif-example update [CHANNEL] [--force | | [-a | -v <value> | -i]] [-b ] | ||
FLAGS | ||
-a, --available See available versions. | ||
-b, --verbose Show more details about the available versions. | ||
-i, --interactive Interactively select version to install. This is ignored if a channel is provided. | ||
@@ -59,3 +60,3 @@ -v, --version=<value> Install a specific version. | ||
_See code: [src/commands/update.ts](https://github.com/oclif/plugin-update/blob/v4.5.10/src/commands/update.ts)_ | ||
_See code: [src/commands/update.ts](https://github.com/oclif/plugin-update/blob/v4.6.0/src/commands/update.ts)_ | ||
<!-- commandsstop --> | ||
@@ -62,0 +63,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37541
890
65
+ Added@oclif/table@^0.1.12
+ Added@alcalzone/ansi-tokenize@0.1.3(transitive)
+ Added@oclif/table@0.1.24(transitive)
+ Added@types/prop-types@15.7.13(transitive)
+ Added@types/react@18.3.12(transitive)
+ Addedansi-escapes@7.0.0(transitive)
+ Addedansi-regex@6.1.0(transitive)
+ Addedansi-styles@6.2.1(transitive)
+ Addedauto-bind@5.0.1(transitive)
+ Addedchalk@5.3.0(transitive)
+ Addedchange-case@5.4.4(transitive)
+ Addedcli-boxes@3.0.0(transitive)
+ Addedcli-cursor@4.0.0(transitive)
+ Addedcli-truncate@4.0.0(transitive)
+ Addedcode-excerpt@4.0.0(transitive)
+ Addedconvert-to-spaces@2.0.1(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addedemoji-regex@10.4.0(transitive)
+ Addedenvironment@1.1.0(transitive)
+ Addedescape-string-regexp@2.0.0(transitive)
+ Addedget-east-asian-width@1.3.0(transitive)
+ Addedindent-string@5.0.0(transitive)
+ Addedink@5.0.1(transitive)
+ Addedis-fullwidth-code-point@4.0.05.0.0(transitive)
+ Addedis-in-ci@0.1.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednatural-orderby@3.0.2(transitive)
+ Addedobject-hash@3.0.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedpatch-console@2.0.0(transitive)
+ Addedreact@18.3.1(transitive)
+ Addedreact-reconciler@0.29.2(transitive)
+ Addedrestore-cursor@4.0.0(transitive)
+ Addedscheduler@0.23.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedslice-ansi@5.0.07.1.0(transitive)
+ Addedstack-utils@2.0.6(transitive)
+ Addedstring-width@7.2.0(transitive)
+ Addedstrip-ansi@7.1.0(transitive)
+ Addedtype-fest@4.26.1(transitive)
+ Addedwidest-line@5.0.0(transitive)
+ Addedwrap-ansi@9.0.0(transitive)
+ Addedws@8.18.0(transitive)
+ Addedyoga-wasm-web@0.3.3(transitive)
- Removedtty-table@^4.2.3
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedarray.prototype.flat@1.3.2(transitive)
- Removedarraybuffer.prototype.slice@1.0.3(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedbreakword@1.0.6(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcamelcase@5.3.1(transitive)
- Removedcliui@6.0.08.0.1(transitive)
- Removedclone@1.0.4(transitive)
- Removedcsv@5.5.3(transitive)
- Removedcsv-generate@3.4.3(transitive)
- Removedcsv-parse@4.16.3(transitive)
- Removedcsv-stringify@5.6.5(transitive)
- Removeddata-view-buffer@1.0.1(transitive)
- Removeddata-view-byte-length@1.0.1(transitive)
- Removeddata-view-byte-offset@1.0.0(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddefaults@1.0.4(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removedes-abstract@1.23.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.0.3(transitive)
- Removedes-shim-unscopables@1.0.2(transitive)
- Removedes-to-primitive@1.2.1(transitive)
- Removedescalade@3.2.0(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunction.prototype.name@1.1.6(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedget-symbol-description@1.0.2(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedgrapheme-splitter@1.0.4(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-data-view@1.0.1(transitive)
- Removedis-date-object@1.0.5(transitive)
- Removedis-negative-zero@2.0.3(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-regex@1.1.4(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedis-weakref@1.0.2(transitive)
- Removedisarray@2.0.5(transitive)
- Removedkleur@4.1.5(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removedmixme@0.5.10(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpath-exists@4.0.0(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedrequire-main-filename@2.0.0(transitive)
- Removedsafe-array-concat@1.1.2(transitive)
- Removedsafe-regex-test@1.0.3(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedsmartwrap@2.0.2(transitive)
- Removedstream-transform@2.1.3(transitive)
- Removedstring.prototype.trim@1.2.9(transitive)
- Removedstring.prototype.trimend@1.0.8(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedtty-table@4.2.3(transitive)
- Removedtyped-array-buffer@1.0.2(transitive)
- Removedtyped-array-byte-length@1.0.1(transitive)
- Removedtyped-array-byte-offset@1.0.2(transitive)
- Removedtyped-array-length@1.0.6(transitive)
- Removedunbox-primitive@1.0.2(transitive)
- Removedwcwidth@1.0.1(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-module@2.0.1(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedy18n@4.0.35.0.8(transitive)
- Removedyargs@15.4.117.7.2(transitive)
- Removedyargs-parser@18.1.321.1.1(transitive)