refactor: ♻️ Don't use Bun global

This commit is contained in:
Jesse Wierzbinski 2025-03-30 23:06:34 +02:00
parent d55668d529
commit 25ea870f71
No known key found for this signature in database
15 changed files with 32 additions and 19 deletions

View file

@ -1,5 +1,6 @@
import { readdir } from "node:fs/promises";
import { type Logger, getLogger } from "@logtape/logtape";
import { file, sleep } from "bun";
import chalk from "chalk";
import { parseJSON5, parseJSONC } from "confbox";
import type { Hono } from "hono";
@ -59,7 +60,7 @@ export class PluginLoader {
manifestPath: string,
manifestFile: string,
): Promise<unknown> {
const manifestText = await Bun.file(manifestPath).text();
const manifestText = await file(manifestPath).text();
try {
if (manifestFile.endsWith(".json")) {
@ -238,7 +239,7 @@ export class PluginLoader {
logger.fatal`Here is the error message, please fix the configuration file accordingly:`;
logger.fatal`${(e as ValidationError).message}`;
await Bun.sleep(Number.POSITIVE_INFINITY);
await sleep(Number.POSITIVE_INFINITY);
}
const time2 = performance.now();