Skip to content

Commit

Permalink
feat: remove @oclif/color (#617)
Browse files Browse the repository at this point in the history
* feat: remove @oclif/color

* fix: chalk import
  • Loading branch information
mdonnalley authored Aug 29, 2023
1 parent 1a49841 commit c2708ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Salesforce",
"bugs": "https://github.com/oclif/plugin-update/issues",
"dependencies": {
"@oclif/color": "^1.0.10",
"@oclif/core": "^2.11.8",
"chalk": "^4",
"cross-spawn": "^7.0.3",
"debug": "^4.3.1",
"filesize": "^6.1.0",
Expand Down Expand Up @@ -81,4 +81,4 @@
"build": "rm -rf lib && tsc"
},
"main": "lib/index.js"
}
}
7 changes: 3 additions & 4 deletions src/update.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable unicorn/prefer-module */
import color from '@oclif/color'
import chalk from 'chalk'
import {Config, ux, Interfaces} from '@oclif/core'

import * as fs from 'fs-extra'
Expand Down Expand Up @@ -235,7 +234,7 @@ export class Updater {

// eslint-disable-next-line max-params
private async update(manifest: Interfaces.S3Manifest, current: string, updated: string, force: boolean, channel: string) {
ux.action.start(`${this.config.name}: Updating CLI from ${color.green(current)} to ${color.green(updated)}${channel === 'stable' ? '' : ' (' + color.yellow(channel) + ')'}`)
ux.action.start(`${this.config.name}: Updating CLI from ${chalk.green(current)} to ${chalk.green(updated)}${channel === 'stable' ? '' : ' (' + chalk.yellow(channel) + ')'}`)

await this.ensureClientDir()
const output = path.join(this.clientRoot, updated)
Expand All @@ -248,7 +247,7 @@ export class Updater {
}

private async updateToExistingVersion(current: string, updated: string): Promise<void> {
ux.action.start(`${this.config.name}: Updating CLI from ${color.green(current)} to ${color.green(updated)}`)
ux.action.start(`${this.config.name}: Updating CLI from ${chalk.green(current)} to ${chalk.green(updated)}`)
await this.ensureClientDir()
await this.refreshConfig(updated)
await this.createBin(updated)
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
node-gyp "^8.2.0"
read-package-json-fast "^2.0.1"

"@oclif/color@^1.0.10", "@oclif/color@^1.0.8":
"@oclif/color@^1.0.8":
version "1.0.10"
resolved "https://registry.yarnpkg.com/@oclif/color/-/color-1.0.10.tgz#e83e3a30fffc93076281398cbeaa4f761c4df09e"
integrity sha512-INWEDAL3SzzR3pIhkrqk22HV6JravLUeRZXAIpoQqIeLReauaibCVcNTzOlt0z0S8YrqRhksc54ZxZC4Oa8xBw==
Expand Down Expand Up @@ -1396,7 +1396,7 @@ chalk@^2.0.0, chalk@^2.4.1:
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"

chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2:
chalk@^4, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
Expand Down

0 comments on commit c2708ea

Please sign in to comment.