diff --git a/app/srv/ws/sync/code/utlis/ensure-lib.ts b/app/srv/ws/sync/code/utlis/ensure-lib.ts index dd9fc901..97bd0d89 100644 --- a/app/srv/ws/sync/code/utlis/ensure-lib.ts +++ b/app/srv/ws/sync/code/utlis/ensure-lib.ts @@ -23,7 +23,7 @@ export const ensureLib = async (src_dir: string, id_site: string) => { const config = site.config as any; if (config.api_url) { new URL(config.api_url); - const url = `${config.api_url}/_prasi/load.js?dev=1`; + const url = `${config.api_url}/_prasi/load.js?dev=1&v3&remote=1`; const res = await fetch(url); const apires = await res.text(); @@ -32,7 +32,7 @@ export const ensureLib = async (src_dir: string, id_site: string) => { const w = {} as any; fn(w, { href: "http://127.0.0.1" }); - const { prismaTypes } = w.prasiApi["http://127.0.0.1/"]; + const { prismaTypes, apiTypes } = w.prasiApi["http://127.0.0.1/"]; for (const [k, v] of Object.entries(prismaTypes)) { await Bun.write(dir.data(`${src_dir}/typings/${k}`), v as any); } diff --git a/app/web/src/sworker-boot.tsx b/app/web/src/sworker-boot.tsx index 728a701e..87765e9b 100644 --- a/app/web/src/sworker-boot.tsx +++ b/app/web/src/sworker-boot.tsx @@ -2,11 +2,6 @@ import { Root as ReactRoot } from "react-dom/client"; import { Root } from "./base/root"; import { w } from "./utils/types/general"; import { isLocalhost } from "./utils/ui/is-localhost"; -import { version } from "../timestamp"; - -const state = { - updating: false, -}; export const sworkerRegister = async (react: { root: null | ReactRoot }) => { if (navigator.serviceWorker) { diff --git a/pkgs/core/server/serve-static.ts b/pkgs/core/server/serve-static.ts index 48e91592..f962a8e3 100644 --- a/pkgs/core/server/serve-static.ts +++ b/pkgs/core/server/serve-static.ts @@ -99,8 +99,15 @@ export const serveStatic = { }); } - if (g.mode === "dev" && url.pathname.endsWith(".js")) { - await this.walk(); + if (url.pathname.endsWith(".js")) { + if (g.mode === "dev") { + await this.walk(); + } else { + return new Response("", { + status: 404, + headers: { "content-type": "text/javascript" }, + }); + } } file = cache.static["/index.html"];