mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: ♻️ Don't use Bun global
This commit is contained in:
parent
d55668d529
commit
25ea870f71
15 changed files with 32 additions and 19 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue