From 959db7268f34352254584256dbe5a2f6b9b7ba3c Mon Sep 17 00:00:00 2001 From: Shane McLaughlin Date: Fri, 7 Jun 2024 10:56:19 -0500 Subject: [PATCH] fix(deps): chalk => standardColors (#604) --- package.json | 1 - src/commands/org/list/shape.ts | 7 ++++--- test/shape/list.test.ts | 7 ++++--- yarn.lock | 31 +++---------------------------- 4 files changed, 11 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 521e1dcd..f810dc03 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "@salesforce/core": "^7.3.8", "@salesforce/kit": "^3.1.2", "@salesforce/sf-plugins-core": "^10.0.0", - "chalk": "^5.3.0", "change-case": "^5.4.4" }, "devDependencies": { diff --git a/src/commands/org/list/shape.ts b/src/commands/org/list/shape.ts index 8d4e6f4d..bdb975c3 100644 --- a/src/commands/org/list/shape.ts +++ b/src/commands/org/list/shape.ts @@ -5,9 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { Flags, loglevel, SfCommand } from '@salesforce/sf-plugins-core'; +import { Flags, loglevel, SfCommand, StandardColors } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core'; -import chalk from 'chalk'; import utils, { OrgShapeListResult } from '../../../shared/orgShapeListUtils.js'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); @@ -54,7 +53,9 @@ export class OrgShapeListCommand extends SfCommand { this.styledHeader('Org Shapes'); this.table( - orgShapes.map((shape) => (shape.status === 'Active' ? { ...shape, status: chalk.green(shape.status) } : shape)), + orgShapes.map((shape) => + shape.status === 'Active' ? { ...shape, status: StandardColors.success(shape.status) } : shape + ), orgShapeColumns ); return orgShapes; diff --git a/test/shape/list.test.ts b/test/shape/list.test.ts index 65cd1721..5f5bfcb0 100644 --- a/test/shape/list.test.ts +++ b/test/shape/list.test.ts @@ -8,11 +8,10 @@ import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import { Config } from '@oclif/core'; -import chalk from 'chalk'; import { use, expect } from 'chai'; import chaiAsPromised from 'chai-as-promised'; import sinon from 'sinon'; -import { SfCommand } from '@salesforce/sf-plugins-core'; +import { SfCommand, StandardColors } from '@salesforce/sf-plugins-core'; import { TestContext, MockTestOrgData } from '@salesforce/core/testSetup'; import { OrgShapeListCommand } from '../../src/commands/org/list/shape.js'; import utils, { OrgShapeListResult } from '../../src/shared/orgShapeListUtils.js'; @@ -82,7 +81,9 @@ describe('org:shape:list', () => { expect(uxStyledHeaderStub.firstCall.args[0]).to.equal('Org Shapes'); expect((uxTableStub.firstCall.args[0] as OrgShapeListResult[]).length).to.equal(2); expect(uxTableStub.firstCall.args[0]).to.deep.equal( - shapes.map((shape) => (shape.status === 'Active' ? { ...shape, status: chalk.green(shape.status) } : shape)) + shapes.map((shape) => + shape.status === 'Active' ? { ...shape, status: StandardColors.success(shape.status) } : shape + ) ); }); diff --git a/yarn.lock b/yarn.lock index 6da1101a..527b85bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7124,16 +7124,7 @@ srcset@^5.0.0: resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.0.tgz#9df6c3961b5b44a02532ce6ae4544832609e2e3f" integrity sha512-SqEZaAEhe0A6ETEa9O1IhSPC7MdvehZtCnTR0AftXk3QhY2UNgb+NApFOUPZILXk/YTDfFxMTNJOBpzrJsEdIA== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7201,14 +7192,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -7771,7 +7755,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -7789,15 +7773,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"