Skip to content

Commit

Permalink
feat: add deprecated info in nextui-cli (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
winchesHe authored Jan 16, 2025
1 parent 33fa8e6 commit 0d68eb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/helpers/output-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')} ❗️`)
});
}
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -197,6 +197,8 @@ nextui.hook('preAction', async (command) => {
});
Logger.newLine();
}

outputDeprecatedInfo();
});

nextui.parseAsync(process.argv).catch(async (reason) => {
Expand Down

0 comments on commit 0d68eb9

Please sign in to comment.