From ea823258df2768bdeb354bdcf43e83cd497a650e Mon Sep 17 00:00:00 2001 From: winches <329487092@qq.com> Date: Sat, 11 Jan 2025 11:01:25 +0800 Subject: [PATCH] feat: add deprecated info in nextui-cli --- src/helpers/output-info.ts | 16 ++++++++++++++++ src/index.ts | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/helpers/output-info.ts b/src/helpers/output-info.ts index 9fe9777..05f9b0b 100644 --- a/src/helpers/output-info.ts +++ b/src/helpers/output-info.ts @@ -336,3 +336,19 @@ export function outputBox({ function generateComponentOutputVersion(currentVersion: string, newVersion: string) { return `${chalk.white(`${currentVersion} ->`)} ${chalk.yellowBright(`${newVersion} (new)`)}`; } + +export function outputDeprecatedInfo() { + outputBox({ + color: 'yellow', + padding: 1, + text: `NextUI has rebranded to HeroUI! These packages are deprecated and won’t receive updates. +HeroUI offers the same great features with ongoing improvements. + +→ ${chalk.bold('Switch to [HeroUI](https://heroui.com) for the latest updates.')} +→ ${chalk.bold('Migration guide:')} [NextUI to HeroUI](https://heroui.com/docs/nextui-to-heroui) +→ ${chalk.bold('New NPM package:')} "@heroui/react" + +Thanks for your support — see you at HeroUI!`, + title: chalk.yellow(`❗️ Notice: NextUI is now ${chalk.bold('HeroUI')} ❗️`) + }); +} diff --git a/src/index.ts b/src/index.ts index e588f07..4f76ce6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import {Command} from 'commander'; import {Logger, gradientString} from '@helpers/logger'; import {findMostMatchText} from '@helpers/math-diff'; -import {outputBox} from '@helpers/output-info'; +import {outputBox, outputDeprecatedInfo} from '@helpers/output-info'; import {getCommandDescAndLog} from '@helpers/utils'; import pkg from '../package.json'; @@ -197,6 +197,8 @@ nextui.hook('preAction', async (command) => { }); Logger.newLine(); } + + outputDeprecatedInfo(); }); nextui.parseAsync(process.argv).catch(async (reason) => {