This commit is contained in:
rizrmd 2024-05-19 16:21:00 +07:00
parent 5b284ec76e
commit 0ce1d627d9
1 changed files with 10 additions and 0 deletions

View File

@ -55,6 +55,16 @@ export const initTypings = async (
code.internal.typings[id_site].watch.on("change", (e, path) => {
clearTimeout(timeout);
timeout = setTimeout(async () => {
try {
const logs = (await typings_log.text()).split("\n");
const idx = logs.findLastIndex((e) =>
e.includes("Watching for file changes.")
);
if (idx > 0) {
Bun.write(typings_log, logs.slice(idx - 1).join("\n"));
}
} catch (e) {}
clearTimeout(timeout);
const glob = new Glob("type_def*");
const path = dir.data(`/code/${id_site}/site/typings.d.ts`);