Skip to content

Commit a3fe458

Browse files
committed
perf: use consola colors
1 parent acb6130 commit a3fe458

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"chokidar": "^4.0.3",
5353
"citty": "^0.1.6",
5454
"clipboardy": "^4.0.0",
55-
"colorette": "^2.0.20",
5655
"consola": "^3.3.3",
5756
"destr": "^2.0.3",
5857
"eslint": "^9.17.0",

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/module/search.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineCommand } from 'citty'
22
import { consola } from 'consola'
33
import Fuse from 'fuse.js'
44
import { upperFirst, kebabCase } from 'scule'
5-
import { bold, green, magenta, cyan, gray, yellow } from 'colorette'
5+
import { colors } from 'consola/utils'
66
import { cwdArgs } from '../_shared'
77
import { fetchModules, checkNuxtCompatibility, getNuxtVersion } from './_utils'
88

@@ -55,6 +55,8 @@ async function findModuleByKeywords(query: string, nuxtVersion: string) {
5555
],
5656
})
5757

58+
const { bold, green, magenta, cyan, gray, yellow } = colors
59+
5860
const results = fuse.search(query).map((result) => {
5961
const res: Record<string, string> = {
6062
name: bold(result.item.name),

src/utils/banner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { bold, gray, green } from 'colorette'
1+
import { colors } from 'consola/utils'
22
import { tryRequireModule } from './cjs'
33

44
export function showVersions(cwd: string) {
5+
const { bold, gray, green } = colors
56
const getPkgVersion = (pkg: string) => {
67
return tryRequireModule(`${pkg}/package.json`, cwd)?.version || ''
78
}

src/utils/update.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { $fetch } from 'ofetch'
2-
import { cyan, green, yellow, underline } from 'colorette'
2+
import { colors } from 'consola/utils'
33
import { consola } from 'consola'
44
import * as semver from 'semver'
55
import nuxiPkg from '../../package.json' assert { type: 'json' }
@@ -15,6 +15,7 @@ export async function checkForUpdates() {
1515
return
1616
}
1717
if (semver.gt(latestVersion, nuxiPkg.version, { loose: true })) {
18+
const { cyan, green, yellow, underline } = colors
1819
const changelogURL = `https://github.com/nuxt/cli/releases/tag/v${latestVersion}`
1920
consola.box({
2021
title: 'Nuxt CLI Update is Available!',

0 commit comments

Comments
 (0)