Skip to content

Commit

Permalink
refactor: move colorette to consola/utils (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaharu authored Feb 7, 2024
1 parent 3b47f5d commit 2e276b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"autoprefixer": "^10.4.17",
"chokidar": "^3.5.3",
"clear-module": "^4.1.2",
"colorette": "^2.0.20",
"consola": "^3.2.3",
"defu": "^6.1.4",
"h3": "^1.10.0",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/viewer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { underline, yellow } from 'colorette'
import { colors } from 'consola/utils'
import { eventHandler, sendRedirect, H3Event } from 'h3'
import { addDevServerHandler, isNuxt2, isNuxt3, useNuxt } from '@nuxt/kit'
import { withTrailingSlash, withoutTrailingSlash, joinURL, cleanDoubleSlashes } from 'ufo'
Expand Down Expand Up @@ -43,7 +43,7 @@ export const setupViewer = async (twConfig: Partial<TWConfig>, config: ViewerCon

nuxt.hook('listen', (_, listener) => {
const viewerUrl = cleanDoubleSlashes(joinURL(listener.url, config.endpoint))
logger.info(`Tailwind Viewer: ${underline(yellow(withTrailingSlash(viewerUrl)))}`)
logger.info(`Tailwind Viewer: ${colors.underline(colors.yellow(withTrailingSlash(viewerUrl)))}`)
})
}

Expand All @@ -57,6 +57,6 @@ export const exportViewer = async (pathToConfig: string, config: ViewerConfig, n

const dir = joinURL(nitro.options.output.publicDir, config.endpoint)
cli(dir, pathToConfig)
logger.success(`Exported viewer to ${yellow(relative(nuxt.options.srcDir, dir))}`)
logger.success(`Exported viewer to ${colors.yellow(relative(nuxt.options.srcDir, dir))}`)
})
}

0 comments on commit 2e276b6

Please sign in to comment.