diff --git a/src/services/notices.service.ts b/src/services/notices.service.ts index 55296aa..9a8070d 100644 --- a/src/services/notices.service.ts +++ b/src/services/notices.service.ts @@ -1,5 +1,5 @@ import { ui } from '../utils/ui.js'; -import { colors, symbols } from '../utils/styling.js'; +import { colors } from '../utils/styling.js'; import { compareSemver } from './version.service.js'; export type NoticeLevel = 'deprecation' | 'warn' | 'info' | 'marketing'; @@ -106,12 +106,11 @@ function renderNotice(notice: Notice, opts: RenderNoticesOptions): void { switch (notice.level) { case 'deprecation': - // Red ⚠ so a deprecation reads as more serious than a plain (yellow) warn. - opts.out(`${colors.error('⚠')} ${colors.bold(notice.title)}`); + opts.out(ui.deprecation(colors.bold(notice.title))); opts.out(ui.branch(rows)); break; case 'warn': - opts.out(`${symbols.warning} ${colors.bold(notice.title)}`); + opts.out(ui.warn(colors.bold(notice.title))); opts.out(ui.branch(rows)); break; case 'marketing': diff --git a/src/utils/styling.ts b/src/utils/styling.ts index 78a3625..53d1e7b 100644 --- a/src/utils/styling.ts +++ b/src/utils/styling.ts @@ -16,6 +16,7 @@ export const stripAnsi = (s: string): string => s.replace(/\u001B\[[0-9;]*m/g, ' */ export const symbols = { cancelled: chalk.gray('⊘'), + deprecation: chalk.red('⚠'), error: chalk.red('✗'), info: chalk.blue('ℹ'), pending: chalk.yellow('⏸'), diff --git a/src/utils/ui.ts b/src/utils/ui.ts index 3977616..7b2b141 100644 --- a/src/utils/ui.ts +++ b/src/utils/ui.ts @@ -70,6 +70,11 @@ export const ui = { }); }, + /** `⚠ message` in red — a deprecation; reads as more serious than a (yellow) {@link warn}. */ + deprecation(message: string): string { + return `${symbols.deprecation} ${message}`; + }, + /** `ℹ message` — neutral, standalone information. */ info(message: string): string { return `${symbols.info} ${message}`;