chore(deps): replace chalk and rimraf with builtin functions (#1879)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
fl0werpowers
2025-05-28 10:40:51 +02:00
committed by GitHub
parent 51b43a2115
commit 951d1dec24
14 changed files with 94 additions and 475 deletions

View File

@ -9,7 +9,7 @@ import { QUARTZ } from "./path"
import { formatDate, getDate } from "../components/Date"
import readingTime from "reading-time"
import { i18n } from "../i18n"
import chalk from "chalk"
import { styleText } from "util"
const defaultHeaderWeight = [700]
const defaultBodyWeight = [400]
@ -100,7 +100,8 @@ export async function fetchTtf(
if (!match) {
console.log(
chalk.yellow(
styleText(
"yellow",
`\nWarning: Failed to fetch font ${rawFontName} with weight ${weight}, got ${cssResponse.statusText}`,
),
)

View File

@ -1,5 +1,5 @@
import chalk from "chalk"
import pretty from "pretty-time"
import { styleText } from "util"
export class PerfTimer {
evts: { [key: string]: [number, number] }
@ -14,6 +14,6 @@ export class PerfTimer {
}
timeSince(evtName?: string): string {
return chalk.yellow(pretty(process.hrtime(this.evts[evtName ?? "start"])))
return styleText("yellow", pretty(process.hrtime(this.evts[evtName ?? "start"])))
}
}

View File

@ -1,4 +1,4 @@
import chalk from "chalk"
import { styleText } from "util"
import process from "process"
import { isMainThread } from "workerpool"
@ -11,9 +11,9 @@ export function trace(msg: string, err: Error) {
lines.push("")
lines.push(
"\n" +
chalk.bgRed.black.bold(" ERROR ") +
styleText(["bgRed", "black", "bold"], " ERROR ") +
"\n\n" +
chalk.red(` ${msg}`) +
styleText("red", ` ${msg}`) +
(err.message.length > 0 ? `: ${err.message}` : ""),
)