From 4fb1bcf2435ba7d57078de5d2fd549a216a0d202 Mon Sep 17 00:00:00 2001 From: Shane McLaughlin Date: Fri, 7 Jun 2024 15:17:34 -0500 Subject: [PATCH] fix(deps): remove chalk (#1053) --- package.json | 1 - src/commands/org/logout.ts | 11 +++++------ src/common.ts | 5 ++--- yarn.lock | 31 +++---------------------------- 4 files changed, 10 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index 78076681..7b935408 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "@salesforce/plugin-info": "^3.3.1", "@salesforce/sf-plugins-core": "^10.0.0", "@salesforce/ts-types": "^2.0.9", - "chalk": "^5.3.0", "open": "^10.1.0" }, "devDependencies": { diff --git a/src/commands/org/logout.ts b/src/commands/org/logout.ts index 57f88087..71936501 100644 --- a/src/commands/org/logout.ts +++ b/src/commands/org/logout.ts @@ -17,8 +17,7 @@ import { OrgConfigProperties, } from '@salesforce/core'; import checkbox, { Separator } from '@inquirer/checkbox'; -import { Flags, loglevel, SfCommand } from '@salesforce/sf-plugins-core'; -import chalk from 'chalk'; +import { Flags, loglevel, SfCommand, StandardColors } from '@salesforce/sf-plugins-core'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-auth', 'logout'); @@ -173,16 +172,16 @@ const buildChoices = (orgAuths: OrgAuthorization[], all: boolean): Array { const aliasString = (orgAuth.aliases ? orgAuth.aliases.join(',') : '').padEnd(maxAliasLength, ' '); const configString = (orgAuth.configs ? orgAuth.configs.join(',') : '').padEnd(maxConfigLength, ' '); - const typeString = chalk.dim( + const typeString = StandardColors.info( (orgAuth.isScratchOrg ? 'Scratch' : orgAuth.isDevHub ? 'DevHub' : orgAuth.isSandbox ? 'Sandbox' : '').padEnd( maxTypeLength, ' ' ) ); // username - aliases - configs - const key = `${chalk.bold( - orgAuth.username.padEnd(maxUsernameLength) - )} | ${typeString} | ${aliasString} | ${chalk.yellowBright(configString)}`; + const key = `${orgAuth.username.padEnd( + maxUsernameLength + )} | ${typeString} | ${aliasString} | ${StandardColors.warning(configString)}`; return { name: key, value: orgAuth, checked: all, short: `${os.EOL}${orgAuth.username}` }; }) .sort((a, b) => a.value.username.localeCompare(b.value.username)); diff --git a/src/common.ts b/src/common.ts index 3d8e524a..86a2e28d 100644 --- a/src/common.ts +++ b/src/common.ts @@ -7,8 +7,7 @@ import { Logger, SfdcUrl, SfProject, Messages, SfError, Global, Mode } from '@salesforce/core'; import { getString, isObject } from '@salesforce/ts-types'; -import chalk from 'chalk'; -import { prompts } from '@salesforce/sf-plugins-core'; +import { prompts, StandardColors } from '@salesforce/sf-plugins-core'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-auth', 'messages'); @@ -45,7 +44,7 @@ const throwIfLightning = (urlString: string): void => { const shouldExitCommand = async (noPrompt?: boolean): Promise => Boolean(noPrompt) || Global.getEnvironmentMode() !== Mode.DEMO ? false - : !(await prompts.confirm({ message: chalk.dim(messages.getMessage('warnAuth', ['sf'])), ms: 60_000 })); + : !(await prompts.confirm({ message: StandardColors.info(messages.getMessage('warnAuth', ['sf'])), ms: 60_000 })); export default { shouldExitCommand, diff --git a/yarn.lock b/yarn.lock index a68aa84a..32447114 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7690,16 +7690,7 @@ srcset@^5.0.0: resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.1.tgz#e660a728f195419e4afa95121099bc9efb7a1e36" integrity sha512-/P1UYbGfJVlxZag7aABNRrulEXAwCSDo7fklafOQrantuPTDmYgijJMks2zusPCVzgW9+4P69mq7w6pYuZpgxw== -"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== @@ -7767,14 +7758,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== @@ -8330,7 +8314,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== @@ -8348,15 +8332,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"