This commit is contained in:
Rizky 2024-07-05 06:03:07 +07:00
parent 72e4c71d61
commit 120f656bb4
1 changed files with 3 additions and 22 deletions

View File

@ -1,16 +1,14 @@
import brotliPromise from "brotli-wasm";
import { dir } from "dir"; import { dir } from "dir";
import mime from "mime";
import { apiContext } from "service-srv"; import { apiContext } from "service-srv";
import { g } from "utils/global";
import { validate } from "uuid"; import { validate } from "uuid";
import { parseTypeDef } from "../util/parse-type-def"; import { parseTypeDef } from "../util/parse-type-def";
import { prodIndex } from "../util/prod-index"; import { prodIndex } from "../util/prod-index";
import { code } from "../ws/sync/code/code"; import { code } from "../ws/sync/code/code";
import { initFrontEnd } from "../ws/sync/code/parts/init/frontend"; import { initFrontEnd } from "../ws/sync/code/parts/init/frontend";
import { gzipAsync } from "../ws/sync/entity/zlib"; import { gzipAsync } from "../ws/sync/entity/zlib";
import { ensureLib } from "../ws/sync/code/utlis/ensure-lib";
import { ensureFiles } from "../ws/sync/code/utlis/ensure-files";
import { g } from "utils/global";
import brotliPromise from "brotli-wasm";
import mime from "mime";
const encoder = new TextEncoder(); const encoder = new TextEncoder();
export const _ = { export const _ = {
@ -115,23 +113,6 @@ export const _ = {
); );
} }
// if (!(await file.exists())) {
// const root = `/code/${site_id}/site/src`;
// await ensureLib(root, site_id);
// await ensureFiles(root, site_id);
// await initFrontEnd(root, site_id);
// await new Promise<void>((resolve) => {
// const ival = setInterval(async () => {
// file = Bun.file(build_path);
// const exists = await file.exists();
// if (exists) {
// clearInterval(ival);
// resolve();
// }
// }, 100);
// });
// }
if (!g.code_index_cache) g.code_index_cache = {}; if (!g.code_index_cache) g.code_index_cache = {};
if (!g.code_index_cache[site_id]) g.code_index_cache[site_id] = {}; if (!g.code_index_cache[site_id]) g.code_index_cache[site_id] = {};
if (!g.code_index_cache[site_id][build_path]) { if (!g.code_index_cache[site_id][build_path]) {