diff --git a/package.json b/package.json index c3f7844..eb6b4f1 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ }, "dependencies": { "clipboardy": "^3.0.0", - "colorette": "^2.0.20", "consola": "^3.2.3", "defu": "^6.1.2", "get-port-please": "^3.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bc54284..b0ca8e4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,6 @@ dependencies: clipboardy: specifier: ^3.0.0 version: 3.0.0 - colorette: - specifier: ^2.0.20 - version: 2.0.20 consola: specifier: ^3.2.3 version: 3.2.3 @@ -1528,6 +1525,7 @@ packages: /colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + dev: true /commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} diff --git a/src/_utils.ts b/src/_utils.ts index 5e12ccf..dae9e72 100644 --- a/src/_utils.ts +++ b/src/_utils.ts @@ -1,6 +1,6 @@ import { promises as fs } from "node:fs"; import { networkInterfaces } from "node:os"; -import { cyan, underline, bold } from "colorette"; +import { colors } from "consola/utils"; import type { Certificate, HTTPSOptions } from "./types"; export async function resolveCert( @@ -60,7 +60,9 @@ export function formatAddress(addr: { } export function formatURL(url: string) { - return cyan( - underline(decodeURI(url).replace(/:(\d+)\//g, `:${bold("$1")}/`)), + return colors.cyan( + colors.underline( + decodeURI(url).replace(/:(\d+)\//g, `:${colors.bold("$1")}/`), + ), ); } diff --git a/src/listen.ts b/src/listen.ts index 33d8f31..41a55bb 100644 --- a/src/listen.ts +++ b/src/listen.ts @@ -9,7 +9,7 @@ import type { AddressInfo } from "node:net"; import { getPort } from "get-port-please"; import addShutdown from "http-shutdown"; import { defu } from "defu"; -import { gray } from "colorette"; +import { colors } from "consola/utils"; import { open } from "./lib/open"; import type { ListenOptions, Listener, ShowURLOptions } from "./types"; import { @@ -103,7 +103,7 @@ export async function listen( } const showURL = (options?: ShowURLOptions) => { - const add = options_.clipboard ? gray("(copied to clipboard)") : ""; + const add = options_.clipboard ? colors.gray("(copied to clipboard)") : ""; const lines = []; const baseURL = options?.baseURL || options_.baseURL || ""; const name = options?.name ? ` (${options.name})` : "";