From 951d1dec24eb8e0bea4ec548cc79c5ce718bf02f Mon Sep 17 00:00:00 2001
From: fl0werpowers <47599466+fl0werpowers@users.noreply.github.com>
Date: Wed, 28 May 2025 08:40:51 +0000
Subject: [PATCH] chore(deps): replace `chalk` and `rimraf` with builtin functions (#1879)
---
quartz/build.ts | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/quartz/build.ts b/quartz/build.ts
index 7cf4405..9e657b6 100644
--- a/quartz/build.ts
+++ b/quartz/build.ts
@@ -2,9 +2,9 @@
sourceMapSupport.install(options)
import path from "path"
import { PerfTimer } from "./util/perf"
-import { rimraf } from "rimraf"
+import { rm } from "fs/promises"
import { GlobbyFilterFunction, isGitIgnored } from "globby"
-import chalk from "chalk"
+import { styleText } from "util"
import { parseMarkdown } from "./processors/parse"
import { filterContent } from "./processors/filter"
import { emitContent } from "./processors/emit"
@@ -67,7 +67,7 @@
const release = await mut.acquire()
perf.addEvent("clean")
- await rimraf(path.join(output, "*"), { glob: true })
+ await rm(output, { recursive: true, force: true })
console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`)
perf.addEvent("glob")
@@ -85,7 +85,9 @@
const filteredContent = filterContent(ctx, parsedFiles)
await emitContent(ctx, filteredContent)
- console.log(chalk.green(`Done processing ${markdownPaths.length} files in ${perf.timeSince()}`))
+ console.log(
+ styleText("green", `Done processing ${markdownPaths.length} files in ${perf.timeSince()}`),
+ )
release()
if (argv.watch) {
@@ -186,7 +188,7 @@
const perf = new PerfTimer()
perf.addEvent("rebuild")
- console.log(chalk.yellow("Detected change, rebuilding..."))
+ console.log(styleText("yellow", "Detected change, rebuilding..."))
// update changesSinceLastBuild
for (const change of changes) {
@@ -281,7 +283,7 @@
}
console.log(`Emitted ${emittedFiles} files to \`${argv.output}\` in ${perf.timeSince("rebuild")}`)
- console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`))
+ console.log(styleText("green", `Done rebuilding in ${perf.timeSince()}`))
changes.splice(0, numChangesInBuild)
clientRefresh()
release()
--
Gitblit v1.10.0