From 5cabe29203c68d438fe47e48d31cf663805dcbc5 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 12 Oct 2023 14:49:47 +0200 Subject: [PATCH] fix: dashboard:open command Signed-off-by: Anatolii Bazko --- package.json | 1 + src/commands/dashboard/open.ts | 3 +- yarn.lock | 87 ++++++++++++++++++++++++++++++++-- 3 files changed, 85 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index b1eb27e79..5a71bef83 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "analytics-node": "^6.2.0", "ansi-colors": "4.1.3", "axios": "^0.21.1", + "cli-ux": "^6.0.9", "command-exists": "^1.2.9", "countries-and-timezones": "^3.4.1", "devworkspace-operator": "https://github.com/devfile/devworkspace-operator#main", diff --git a/src/commands/dashboard/open.ts b/src/commands/dashboard/open.ts index 1fe33d0f3..255d667ff 100644 --- a/src/commands/dashboard/open.ts +++ b/src/commands/dashboard/open.ts @@ -12,6 +12,7 @@ import { Command, Flags } from '@oclif/core' import { ux } from '@oclif/core' +import cli from 'cli-ux' import { CheCtlContext } from '../../context' import { @@ -42,7 +43,7 @@ export default class Open extends Command { const dashboardUrl = Che.buildDashboardURL(await Che.getCheURL(flags[CHE_NAMESPACE_FLAG]!)) ux.info(`Opening ... ${dashboardUrl}`) - await open(dashboardUrl) + await cli.open(dashboardUrl) } catch (error: any) { this.error(error) } diff --git a/yarn.lock b/yarn.lock index 49d1b3969..7f7f5a597 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1218,6 +1218,40 @@ is-wsl "^2.1.1" tslib "^2.3.1" +"@oclif/core@^1.1.1": + version "1.26.2" + resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.26.2.tgz#763c68dc91388225acd6f0819c90f93e5d8cde41" + integrity sha512-6jYuZgXvHfOIc9GIaS4T3CIKGTjPmfAxuMcbCbMRKJJl4aq/4xeRlEz0E8/hz8HxvxZBGvN2GwAUHlrGWQVrVw== + dependencies: + "@oclif/linewrap" "^1.0.0" + "@oclif/screen" "^3.0.4" + ansi-escapes "^4.3.2" + ansi-styles "^4.3.0" + cardinal "^2.1.1" + chalk "^4.1.2" + clean-stack "^3.0.1" + cli-progress "^3.10.0" + debug "^4.3.4" + ejs "^3.1.6" + fs-extra "^9.1.0" + get-package-type "^0.1.0" + globby "^11.1.0" + hyperlinker "^1.0.0" + indent-string "^4.0.0" + is-wsl "^2.2.0" + js-yaml "^3.14.1" + natural-orderby "^2.0.3" + object-treeify "^1.1.33" + password-prompt "^1.1.2" + semver "^7.3.7" + string-width "^4.2.3" + strip-ansi "^6.0.1" + supports-color "^8.1.1" + supports-hyperlinks "^2.2.0" + tslib "^2.4.1" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + "@oclif/core@^2.11.4", "@oclif/core@^2.15.0", "@oclif/core@^2.8.5": version "2.15.0" resolved "https://registry.npmjs.org/@oclif/core/-/core-2.15.0.tgz#f27797b30a77d13279fba88c1698fc34a0bd0d2a" @@ -1400,11 +1434,16 @@ lodash.template "^4.5.0" semver "^7.5.4" -"@oclif/screen@^1.0.4": +"@oclif/screen@^1.0.4", "@oclif/screen@^1.0.4 ": version "1.0.4" resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.4.tgz#b740f68609dfae8aa71c3a6cab15d816407ba493" integrity sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw== +"@oclif/screen@^3.0.4": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-3.0.7.tgz#1db88a8d9f143d3c96dab9e6bbb630f298ba6256" + integrity sha512-jQBPHcMh5rcIPKdqA6xlzioLOmkaVnjg2MVyjMzBKV8hDhLWNSiZqx7NAWXpP70v2LFvGdVoV8BSbK9iID3eHg== + "@oclif/test@^2": version "2.3.22" resolved "https://registry.yarnpkg.com/@oclif/test/-/test-2.3.22.tgz#5c7278fbc339e5a43c5529f5d367615dccd5955f" @@ -3135,7 +3174,7 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-progress@^3.12.0: +cli-progress@^3.10.0, cli-progress@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/cli-progress/-/cli-progress-3.12.0.tgz#807ee14b66bcc086258e444ad0f19e7d42577942" integrity sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A== @@ -3201,6 +3240,37 @@ cli-ux@^5.5.1: supports-hyperlinks "^2.1.0" tslib "^2.0.0" +cli-ux@^6.0.9: + version "6.0.9" + resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-6.0.9.tgz#b5ab690314348b45b2c7458dad7621ae1be7c61d" + integrity sha512-0Ku29QLf+P6SeBNWM7zyoJ49eKKOjxZBZ4OH2aFeRtC0sNXU3ftdJxQPKJ1SJ+axX34I1NsfTFahpXdnxklZgA== + dependencies: + "@oclif/core" "^1.1.1" + "@oclif/linewrap" "^1.0.0" + "@oclif/screen" "^1.0.4 " + ansi-escapes "^4.3.0" + ansi-styles "^4.2.0" + cardinal "^2.1.1" + chalk "^4.1.0" + clean-stack "^3.0.0" + cli-progress "^3.10.0" + extract-stack "^2.0.0" + fs-extra "^8.1" + hyperlinker "^1.0.0" + indent-string "^4.0.0" + is-wsl "^2.2.0" + js-yaml "^3.13.1" + lodash "^4.17.21" + natural-orderby "^2.0.1" + object-treeify "^1.1.4" + password-prompt "^1.1.2" + semver "^7.3.2" + string-width "^4.2.0" + strip-ansi "^6.0.0" + supports-color "^8.1.0" + supports-hyperlinks "^2.1.0" + tslib "^2.0.0" + cli-width@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" @@ -3631,6 +3701,13 @@ editorconfig@^0.15.0: semver "^5.6.0" sigmund "^1.0.1" +ejs@^3.1.6: + version "3.1.9" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.9.tgz#03c9e8777fe12686a9effcef22303ca3d8eeb361" + integrity sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ== + dependencies: + jake "^10.8.5" + ejs@^3.1.8: version "3.1.8" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.8.tgz#758d32910c78047585c7ef1f92f9ee041c1c190b" @@ -4338,7 +4415,7 @@ fs-extra@^8.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.1: +fs-extra@^9.0.1, fs-extra@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== @@ -7662,7 +7739,7 @@ semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4: +semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -8322,7 +8399,7 @@ tslib@^2.0.0, tslib@^2.3.1, tslib@^2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== -tslib@^2.1.0, tslib@^2.6.2: +tslib@^2.1.0, tslib@^2.4.1, tslib@^2.6.2: version "2.6.2" resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==