diff --git a/packages/contentstack-audit/package.json b/packages/contentstack-audit/package.json index 36724da19..7fd9cee19 100644 --- a/packages/contentstack-audit/package.json +++ b/packages/contentstack-audit/package.json @@ -22,7 +22,7 @@ "@contentstack/cli-utilities": "~2.0.0-beta.2", "@oclif/core": "^4.3.0", "@oclif/plugin-help": "^6.2.28", - "chalk": "^4.1.2", + "chalk": "^5.6.2", "fast-csv": "^4.3.6", "fs-extra": "^11.3.0", "lodash": "^4.17.23", diff --git a/packages/contentstack-audit/src/audit-base-command.ts b/packages/contentstack-audit/src/audit-base-command.ts index dc5d58635..afc5f632c 100644 --- a/packages/contentstack-audit/src/audit-base-command.ts +++ b/packages/contentstack-audit/src/audit-base-command.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import * as csv from 'fast-csv'; import { copy } from 'fs-extra'; import { v4 as uuid } from 'uuid'; @@ -55,7 +55,7 @@ export abstract class AuditBaseCommand extends BaseCommand { - return row.fixStatus === 'Fixed' ? chalk.greenBright(row.fixStatus) : chalk.redBright(row.fixStatus); + return row.fixStatus === 'Fixed' ? getChalk().greenBright(row.fixStatus) : getChalk().redBright(row.fixStatus); }, }, }; @@ -548,7 +548,7 @@ export abstract class AuditBaseCommand extends BaseCommand { - return chalk.red(typeof cellValue === 'object' ? JSON.stringify(cellValue) : cellValue); + return getChalk().red(typeof cellValue === 'object' ? JSON.stringify(cellValue) : cellValue); }, }, { @@ -588,7 +588,7 @@ export abstract class AuditBaseCommand extends BaseCommand { if (key === 'fixStatus' || key === 'Fixable' || key === 'Fixed') { - return chalk.green(typeof cellValue === 'object' ? JSON.stringify(cellValue) : cellValue); + return getChalk().green(typeof cellValue === 'object' ? JSON.stringify(cellValue) : cellValue); } else if ( key === 'content_types' || key === 'branches' || @@ -598,9 +598,9 @@ export abstract class AuditBaseCommand extends BaseCommand): void { + const chalk = getChalk(); const str = map(printInput, ({ message, bold, color }: PrintType) => { - let chalkFn: Chalk = chalk; - if (color) chalkFn = chalkFn[color]; - if (bold) chalkFn = chalkFn.bold; + let chalkFn: ChalkInstance = chalk; + if (color) chalkFn = chalkFn[color] as ChalkInstance; + if (bold) chalkFn = chalkFn.bold as ChalkInstance; return chalkFn(message); }).join(' '); diff --git a/packages/contentstack-branches/package.json b/packages/contentstack-branches/package.json index 181de809c..a435ba54e 100644 --- a/packages/contentstack-branches/package.json +++ b/packages/contentstack-branches/package.json @@ -9,7 +9,7 @@ "@oclif/core": "^4.3.0", "@oclif/plugin-help": "^6.2.28", "@contentstack/cli-utilities": "~2.0.0-beta.2", - "chalk": "^4.1.2", + "chalk": "^5.6.2", "just-diff": "^6.0.2", "lodash": "^4.17.23" }, diff --git a/packages/contentstack-branches/src/branch/merge-handler.ts b/packages/contentstack-branches/src/branch/merge-handler.ts index 0d2755215..60b371e28 100644 --- a/packages/contentstack-branches/src/branch/merge-handler.ts +++ b/packages/contentstack-branches/src/branch/merge-handler.ts @@ -2,7 +2,7 @@ import os from 'os'; import path from 'path'; import forEach from 'lodash/forEach'; import { cliux } from '@contentstack/cli-utilities'; -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import { MergeInputOptions, MergeSummary } from '../interfaces'; import { selectMergeStrategy, @@ -140,7 +140,7 @@ export default class MergeHandler { const strategyName = this.mergeSettings.strategy; if (allEmpty) { - cliux.print(chalk.red(`No items selected according to the '${strategyName}' strategy.`)); + cliux.print(getChalk().red(`No items selected according to the '${strategyName}' strategy.`)); process.exit(1); } @@ -148,7 +148,7 @@ export default class MergeHandler { if (exists && empty) { const readable = type === 'contentType' ? 'Content Types' : 'Global fields'; cliux.print('\n') - cliux.print(chalk.yellow(`Note: No ${readable} selected according to the '${strategyName}' strategy.`)); + cliux.print(getChalk().yellow(`Note: No ${readable} selected according to the '${strategyName}' strategy.`)); } } diff --git a/packages/contentstack-branches/src/commands/cm/branches/index.ts b/packages/contentstack-branches/src/commands/cm/branches/index.ts index 1a399c698..65a8cce9b 100644 --- a/packages/contentstack-branches/src/commands/cm/branches/index.ts +++ b/packages/contentstack-branches/src/commands/cm/branches/index.ts @@ -8,7 +8,7 @@ import { TableHeader, } from '@contentstack/cli-utilities'; import { getbranchesList, getbranchConfig, interactive, handleErrorMsg } from '../../../utils/index'; -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; export default class BranchListCommand extends Command { static description: string = messageHandler.parse('List the branches'); // Note: Update the description @@ -54,10 +54,10 @@ export default class BranchListCommand extends Command { if (!verbose) { currentBranch[0]?.Source - ? cliux.print(`* ${chalk.bold(currentBranch[0].Branch)} (source: ${currentBranch[0].Source})`, { + ? cliux.print(`* ${getChalk().bold(currentBranch[0].Branch)} (source: ${currentBranch[0].Source})`, { color: 'blue', }) - : cliux.print(`* ${chalk.bold(currentBranch[0].Branch)}`, { + : cliux.print(`* ${getChalk().bold(currentBranch[0].Branch)}`, { color: 'blue', }); diff --git a/packages/contentstack-branches/src/utils/branch-diff-utility.ts b/packages/contentstack-branches/src/utils/branch-diff-utility.ts index fc76eb5d5..2828ebd63 100644 --- a/packages/contentstack-branches/src/utils/branch-diff-utility.ts +++ b/packages/contentstack-branches/src/utils/branch-diff-utility.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import forEach from 'lodash/forEach'; import padStart from 'lodash/padStart'; import startCase from 'lodash/startCase'; @@ -196,19 +196,19 @@ function printCompactTextView(branchTextRes: BranchCompactTextRes): void { cliux.print(' '); forEach(branchTextRes.added, (diff: BranchDiffRes) => { if (diff.merge_strategy !== 'ignore') { - cliux.print(chalk.green(`+ '${diff.title}' ${startCase(camelCase(diff.type))}`)); + cliux.print(getChalk().green(`+ '${diff.title}' ${startCase(camelCase(diff.type))}`)); } }); forEach(branchTextRes.modified, (diff: BranchDiffRes) => { if (diff.merge_strategy !== 'ignore') { - cliux.print(chalk.blue(`± '${diff.title}' ${startCase(camelCase(diff.type))}`)); + cliux.print(getChalk().blue(`± '${diff.title}' ${startCase(camelCase(diff.type))}`)); } }); forEach(branchTextRes.deleted, (diff: BranchDiffRes) => { if (diff.merge_strategy !== 'ignore') { - cliux.print(chalk.red(`- '${diff.title}' ${startCase(camelCase(diff.type))}`)); + cliux.print(getChalk().red(`- '${diff.title}' ${startCase(camelCase(diff.type))}`)); } }); } @@ -442,16 +442,16 @@ function printVerboseTextView(branchTextRes: BranchDiffVerboseRes): void { if (branchTextRes.modified?.length || branchTextRes.added?.length || branchTextRes.deleted?.length) { cliux.print(' '); forEach(branchTextRes.added, (diff: BranchDiffRes) => { - cliux.print(chalk.green(`+ '${diff.title}' ${startCase(camelCase(diff.type))}`)); + cliux.print(getChalk().green(`+ '${diff.title}' ${startCase(camelCase(diff.type))}`)); }); forEach(branchTextRes.modified, (diff: BranchModifiedDetails) => { - cliux.print(chalk.blue(`± '${diff.moduleDetails.title}' ${startCase(camelCase(diff.moduleDetails.type))}`)); + cliux.print(getChalk().blue(`± '${diff.moduleDetails.title}' ${startCase(camelCase(diff.moduleDetails.type))}`)); printModifiedFields(diff.modifiedFields); }); forEach(branchTextRes.deleted, (diff: BranchDiffRes) => { - cliux.print(chalk.red(`- '${diff.title}' ${startCase(camelCase(diff.type))}`)); + cliux.print(getChalk().red(`- '${diff.title}' ${startCase(camelCase(diff.type))}`)); }); } } @@ -466,17 +466,17 @@ function printModifiedFields(modfiedFields: ModifiedFieldsInput): void { forEach(modfiedFields.modified, (diff: ModifiedFieldsType) => { const field: string = diff.field ? `${diff.field}` : 'field'; const fieldDetail = diff.path ? `(${diff.path}) ${field}`: `${field}`; - cliux.print(` ${chalk.blue(`± "${diff.displayName}" ${fieldDetail}`)}`); + cliux.print(` ${getChalk().blue(`± "${diff.displayName}" ${fieldDetail}`)}`); }); forEach(modfiedFields.added, (diff: ModifiedFieldsType) => { const field: string = diff.field ? `${diff.field} field` : 'field'; - cliux.print(` ${chalk.green(`+ "${diff.displayName}" (${diff.path}) ${field}`)}`); + cliux.print(` ${getChalk().green(`+ "${diff.displayName}" (${diff.path}) ${field}`)}`); }); forEach(modfiedFields.deleted, (diff: ModifiedFieldsType) => { const field: string = diff.field ? `${diff.field} field` : 'field'; - cliux.print(` ${chalk.red(`- "${diff.displayName}" (${diff.path}) ${field}`)}`); + cliux.print(` ${getChalk().red(`- "${diff.displayName}" (${diff.path}) ${field}`)}`); }); } } diff --git a/packages/contentstack-clone/package.json b/packages/contentstack-clone/package.json index 7ec09561c..49461f96e 100644 --- a/packages/contentstack-clone/package.json +++ b/packages/contentstack-clone/package.json @@ -12,7 +12,7 @@ "@contentstack/cli-utilities": "~2.0.0-beta.2", "@oclif/core": "^4.3.0", "@oclif/plugin-help": "^6.2.28", - "chalk": "^4.1.2", + "chalk": "^5.6.2", "inquirer": "12.11.1", "lodash": "^4.17.23", "merge": "^2.1.1", diff --git a/packages/contentstack-clone/src/core/util/clone-handler.ts b/packages/contentstack-clone/src/core/util/clone-handler.ts index 412d3bad1..e9a869465 100644 --- a/packages/contentstack-clone/src/core/util/clone-handler.ts +++ b/packages/contentstack-clone/src/core/util/clone-handler.ts @@ -1,7 +1,7 @@ import { Ora, default as ora } from 'ora'; import * as path from 'path'; import inquirer from 'inquirer'; -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import * as fs from 'fs'; import { rimraf } from 'rimraf'; import { CustomAbortController } from './abort-controller'; @@ -170,7 +170,7 @@ export class CloneHandler { } displayBackOptionMessage(): void { - process.stdout.write(chalk.cyan('\nPress shift & left arrow together to undo the operation\n')); + process.stdout.write(getChalk().cyan('\nPress shift & left arrow together to undo the operation\n')); } setBackKeyPressHandler(backKeyPressHandler: (...args: any[]) => void): void { diff --git a/packages/contentstack-export/package.json b/packages/contentstack-export/package.json index 53c277ce8..b9cdaa13d 100644 --- a/packages/contentstack-export/package.json +++ b/packages/contentstack-export/package.json @@ -12,7 +12,7 @@ "async": "^3.2.6", "big-json": "^3.2.0", "bluebird": "^3.7.2", - "chalk": "^4.1.2", + "chalk": "^5.6.2", "lodash": "^4.17.23", "merge": "^2.1.1", "mkdirp": "^1.0.4", diff --git a/packages/contentstack-export/src/export/modules/assets.ts b/packages/contentstack-export/src/export/modules/assets.ts index 0d6233f0e..7f3130265 100644 --- a/packages/contentstack-export/src/export/modules/assets.ts +++ b/packages/contentstack-export/src/export/modules/assets.ts @@ -1,5 +1,5 @@ import map from 'lodash/map'; -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import chunk from 'lodash/chunk'; import first from 'lodash/first'; import merge from 'lodash/merge'; @@ -57,7 +57,7 @@ export default class ExportAssets extends BaseClass { log.debug('Fetching assets and folders count...', this.exportConfig.context); // NOTE step 1: Get assets and it's folder count in parallel const [assetsCount, assetsFolderCount] = await this.withLoadingSpinner( - `${chalk.bold('ASSETS')}: Analyzing stack content...`, + `${getChalk().bold('ASSETS')}: Analyzing stack content...`, () => Promise.all([this.getAssetsCount(), this.getAssetsCount(true)]), ); diff --git a/packages/contentstack-import-setup/package.json b/packages/contentstack-import-setup/package.json index 7a9b83bc0..6d2af4cda 100644 --- a/packages/contentstack-import-setup/package.json +++ b/packages/contentstack-import-setup/package.json @@ -9,7 +9,7 @@ "@contentstack/cli-utilities": "~2.0.0-beta.2", "@oclif/core": "^4.3.0", "big-json": "^3.2.0", - "chalk": "^4.1.2", + "chalk": "^5.6.2", "fs-extra": "^11.3.0", "lodash": "^4.17.23", "merge": "^2.1.1", diff --git a/packages/contentstack-import-setup/src/import/modules/assets.ts b/packages/contentstack-import-setup/src/import/modules/assets.ts index d9b7f0a9b..c727a0ab3 100644 --- a/packages/contentstack-import-setup/src/import/modules/assets.ts +++ b/packages/contentstack-import-setup/src/import/modules/assets.ts @@ -1,4 +1,3 @@ -import * as chalk from 'chalk'; import { log, fsUtil } from '../../utils'; import { join } from 'path'; import { AssetRecord, ImportConfig, ModuleClassParams } from '../../types'; diff --git a/packages/contentstack-import-setup/src/import/modules/content-types.ts b/packages/contentstack-import-setup/src/import/modules/content-types.ts index c06036a33..da3bd1e31 100644 --- a/packages/contentstack-import-setup/src/import/modules/content-types.ts +++ b/packages/contentstack-import-setup/src/import/modules/content-types.ts @@ -1,4 +1,3 @@ -import * as chalk from 'chalk'; import { log, fsUtil } from '../../utils'; import { join } from 'path'; import { ImportConfig, ModuleClassParams } from '../../types'; diff --git a/packages/contentstack-import-setup/src/import/modules/extensions.ts b/packages/contentstack-import-setup/src/import/modules/extensions.ts index 31e108d7f..4eacb5d8b 100644 --- a/packages/contentstack-import-setup/src/import/modules/extensions.ts +++ b/packages/contentstack-import-setup/src/import/modules/extensions.ts @@ -1,4 +1,3 @@ -import * as chalk from 'chalk'; import { log, fsUtil } from '../../utils'; import { join } from 'path'; import { ImportConfig, ModuleClassParams } from '../../types'; diff --git a/packages/contentstack-import-setup/src/import/modules/global-fields.ts b/packages/contentstack-import-setup/src/import/modules/global-fields.ts index 1ade77000..55475b86d 100644 --- a/packages/contentstack-import-setup/src/import/modules/global-fields.ts +++ b/packages/contentstack-import-setup/src/import/modules/global-fields.ts @@ -1,4 +1,3 @@ -import * as chalk from 'chalk'; import { log, fsUtil } from '../../utils'; import { join } from 'path'; import { ImportConfig, ModuleClassParams } from '../../types'; diff --git a/packages/contentstack-import-setup/src/utils/common-helper.ts b/packages/contentstack-import-setup/src/utils/common-helper.ts index 89e4e0312..793a18692 100644 --- a/packages/contentstack-import-setup/src/utils/common-helper.ts +++ b/packages/contentstack-import-setup/src/utils/common-helper.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import { log as defaultLog } from '@contentstack/cli-utilities'; import { ImportConfig } from 'src/types'; @@ -22,8 +22,8 @@ export const validateBranch = async ( const data = await stackAPIClient.branch(branch).fetch(); if (data && typeof data === 'object') { if (data.error_message) { - log.error(chalk.red(data.error_message), { error: data.error_message }); - log.error(chalk.red('No branch found with the name ' + branch), { branch }); + log.error(getChalk().red(data.error_message), { error: data.error_message }); + log.error(getChalk().red('No branch found with the name ' + branch), { branch }); reject({ message: 'No branch found with the name ' + branch, error: data.error_message }); } else { resolve(data); @@ -32,7 +32,7 @@ export const validateBranch = async ( reject({ message: 'No branch found with the name ' + branch, error: {} }); } } catch (error) { - log.error(chalk.red('No branch found with the name ' + branch), { error, branch }); + log.error(getChalk().red('No branch found with the name ' + branch), { error, branch }); reject({ message: 'No branch found with the name ' + branch, error }); } }); diff --git a/packages/contentstack-import/package.json b/packages/contentstack-import/package.json index a1cddafbd..42c97cfee 100644 --- a/packages/contentstack-import/package.json +++ b/packages/contentstack-import/package.json @@ -12,7 +12,7 @@ "@oclif/core": "^4.3.0", "big-json": "^3.2.0", "bluebird": "^3.7.2", - "chalk": "^4.1.2", + "chalk": "^5.6.2", "debug": "^4.4.3", "fs-extra": "^11.3.3", "lodash": "^4.17.23", diff --git a/packages/contentstack-import/src/import/modules/marketplace-apps.ts b/packages/contentstack-import/src/import/modules/marketplace-apps.ts index 70b136cd7..cb150583a 100644 --- a/packages/contentstack-import/src/import/modules/marketplace-apps.ts +++ b/packages/contentstack-import/src/import/modules/marketplace-apps.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import map from 'lodash/map'; import omit from 'lodash/omit'; import find from 'lodash/find'; @@ -551,7 +551,7 @@ export default class ImportMarketplaceApps extends BaseClass { if ( await cliux.confirm( - chalk.yellow( + getChalk().yellow( 'WARNING!!! The above error may have an impact if the failed app is referenced in entries/content type. Would you like to proceed? (y/n)', ), ) diff --git a/packages/contentstack-import/src/import/modules/workflows.ts b/packages/contentstack-import/src/import/modules/workflows.ts index 4ce37ad57..76faa64e4 100644 --- a/packages/contentstack-import/src/import/modules/workflows.ts +++ b/packages/contentstack-import/src/import/modules/workflows.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import map from 'lodash/map'; import find from 'lodash/find'; import { join } from 'node:path'; @@ -290,7 +290,7 @@ export default class ImportWorkflows extends BaseClass { } else { if (workflow.admin_users !== undefined) { log.info( - chalk.yellow('We are skipping import of `Workflow superuser(s)` from workflow'), + getChalk().yellow('We are skipping import of `Workflow superuser(s)` from workflow'), this.importConfig.context, ); delete workflow.admin_users; diff --git a/packages/contentstack-import/src/utils/common-helper.ts b/packages/contentstack-import/src/utils/common-helper.ts index 6256f89e1..c685dc74b 100644 --- a/packages/contentstack-import/src/utils/common-helper.ts +++ b/packages/contentstack-import/src/utils/common-helper.ts @@ -18,7 +18,6 @@ import { import { PATH_CONSTANTS } from '../constants'; import { readFileSync, readdirSync, readFile, fileExistsSync } from './file-helper'; -import chalk from 'chalk'; import defaultConfig from '../config'; import promiseLimit from 'promise-limit'; import { ImportConfig } from '../types'; diff --git a/packages/contentstack-import/src/utils/marketplace-app-helper.ts b/packages/contentstack-import/src/utils/marketplace-app-helper.ts index dd94d0e6d..3d2860ae3 100644 --- a/packages/contentstack-import/src/utils/marketplace-app-helper.ts +++ b/packages/contentstack-import/src/utils/marketplace-app-helper.ts @@ -1,4 +1,4 @@ -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import map from 'lodash/map'; import omitBy from 'lodash/omitBy'; import isEmpty from 'lodash/isEmpty'; @@ -93,7 +93,7 @@ export const getConfirmationToCreateApps = async (privateApps: any, config: Impo if (!config.forceStopMarketplaceAppsPrompt) { if ( !(await cliux.confirm( - chalk.yellow( + getChalk().yellow( `WARNING!!! The listed apps are private apps that are not available in the destination stack: \n\n${map( privateApps, ({ manifest: { name } }, index) => `${String(index + 1)}) ${name}`, @@ -105,7 +105,7 @@ export const getConfirmationToCreateApps = async (privateApps: any, config: Impo if ( await cliux.confirm( - chalk.yellow( + getChalk().yellow( `\nWARNING!!! Canceling the app re-creation may break the content type and entry import. Would you like to proceed without re-create the private app? (y/n)`, ), ) @@ -115,7 +115,7 @@ export const getConfirmationToCreateApps = async (privateApps: any, config: Impo } else { if ( await cliux.confirm( - chalk.yellow('\nWould you like to re-create the private app and then proceed with the installation? (y/n)'), + getChalk().yellow('\nWould you like to re-create the private app and then proceed with the installation? (y/n)'), ) ) { log.info('User confirmed to create private apps'); @@ -180,7 +180,7 @@ export const confirmToCloseProcess = async (installation: any, config: ImportCon if (!config.forceStopMarketplaceAppsPrompt) { if ( !(await cliux.confirm( - chalk.yellow( + getChalk().yellow( 'WARNING!!! The above error may have an impact if the failed app is referenced in entries/content type. Would you like to proceed? (y/n)', ), )) diff --git a/packages/contentstack-migration/package.json b/packages/contentstack-migration/package.json index 6806e6e5c..6368eba1a 100644 --- a/packages/contentstack-migration/package.json +++ b/packages/contentstack-migration/package.json @@ -11,7 +11,7 @@ "async": "^3.2.6", "callsites": "^3.1.0", "cardinal": "^2.1.1", - "chalk": "^4.1.2", + "chalk": "^5.6.2", "concat-stream": "^2.0.0", "listr": "^0.14.3", "rxjs": "^6.6.7", diff --git a/packages/contentstack-migration/src/utils/error-helper.ts b/packages/contentstack-migration/src/utils/error-helper.ts index 51ff4b6a9..066388d90 100644 --- a/packages/contentstack-migration/src/utils/error-helper.ts +++ b/packages/contentstack-migration/src/utils/error-helper.ts @@ -1,6 +1,6 @@ // @ts-ignore - no types available import { highlight } from 'cardinal'; -import chalk from 'chalk'; +import { getChalk } from '@contentstack/cli-utilities'; import isEmpty from 'lodash/isEmpty'; import MigrationLogger from './migration-logger'; import fs from 'fs'; @@ -46,7 +46,7 @@ export default (errors: any, filePath?: string): void => { const highlightedCode = highlight(fileContents, { linenos: true }); const lines = highlightedCode.split('\n'); - const fileErrorsMessage = chalk`{red Errors in ${file}}\n\n`; + const fileErrorsMessage = (getChalk())`{red Errors in ${file}}\n\n`; errorLogs[file].fileErrorsMessage = fileErrorsMessage.replace(/\u001b\[\d+m/g, ''); const errorMessages = errorsByFile[file] .map((error: any) => { @@ -54,9 +54,9 @@ export default (errors: any, filePath?: string): void => { const context = 2; let { before, line, after } = getLineWithContext(lines, callsite.line, context); - const beforeLines = before.map((_line: string) => chalk`${_line}\n`); - const afterLines = after.map((_line: string) => chalk`${_line}\n`); - const highlightedLine = chalk`{bold ${line}}\n`; + const beforeLines = before.map((_line: string) => (getChalk())`${_line}\n`); + const afterLines = after.map((_line: string) => (getChalk())`${_line}\n`); + const highlightedLine = (getChalk())`{bold ${line}}\n`; before = removeSpecialCharacter(before.join('\n')); after = removeSpecialCharacter(after.join('\n')); @@ -95,7 +95,7 @@ export default (errors: any, filePath?: string): void => { } if (isEmpty(messages) && errors !== undefined && isEmpty(errorsByFile)) { logger.log('error', { errors: errors }); - console.log(chalk`{bold.red migration unsuccessful}`); + console.log((getChalk())`{bold.red migration unsuccessful}`); } else { logger.log('error', { error: messages.join('\n') }); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45af8233e..a7c3c910b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: ^6.2.28 version: 6.2.37 chalk: - specifier: ^4.1.2 - version: 4.1.2 + specifier: ^5.6.2 + version: 5.6.2 fast-csv: specifier: ^4.3.6 version: 4.3.6 @@ -191,8 +191,8 @@ importers: specifier: ^6.2.28 version: 6.2.37 chalk: - specifier: ^4.1.2 - version: 4.1.2 + specifier: ^5.6.2 + version: 5.6.2 just-diff: specifier: ^6.0.2 version: 6.0.2 @@ -264,8 +264,8 @@ importers: specifier: ^6.2.28 version: 6.2.37 chalk: - specifier: ^4.1.2 - version: 4.1.2 + specifier: ^5.6.2 + version: 5.6.2 inquirer: specifier: 12.11.1 version: 12.11.1(@types/node@18.19.130) @@ -355,8 +355,8 @@ importers: specifier: ^3.7.2 version: 3.7.2 chalk: - specifier: ^4.1.2 - version: 4.1.2 + specifier: ^5.6.2 + version: 5.6.2 lodash: specifier: ^4.17.23 version: 4.17.23 @@ -537,8 +537,8 @@ importers: specifier: ^3.7.2 version: 3.7.2 chalk: - specifier: ^4.1.2 - version: 4.1.2 + specifier: ^5.6.2 + version: 5.6.2 debug: specifier: ^4.4.3 version: 4.4.3(supports-color@8.1.1) @@ -640,8 +640,8 @@ importers: specifier: ^3.2.0 version: 3.2.0 chalk: - specifier: ^4.1.2 - version: 4.1.2 + specifier: ^5.6.2 + version: 5.6.2 fs-extra: specifier: ^11.3.0 version: 11.3.4 @@ -752,8 +752,8 @@ importers: specifier: ^2.1.1 version: 2.1.1 chalk: - specifier: ^4.1.2 - version: 4.1.2 + specifier: ^5.6.2 + version: 5.6.2 concat-stream: specifier: ^2.0.0 version: 2.0.0 @@ -3049,6 +3049,10 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + change-case@4.1.2: resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==} @@ -10149,6 +10153,8 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + chalk@5.6.2: {} + change-case@4.1.2: dependencies: camel-case: 4.1.2