Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Build: no more whole-project tracing warnings from Turbopack

Claude139928f21703
diff --git a/src/app/(studio)/settings/about/page.tsx b/src/app/(studio)/settings/about/page.tsx
index 52573ef5..002e96de 100644
--- a/src/app/(studio)/settings/about/page.tsx
+++ b/src/app/(studio)/settings/about/page.tsx
@@ -12,9 +12,10 @@ import { buildLicenceList } from "@/lib/licences";
export const metadata: Metadata = { title: "About & licences" };
-async function readJson<T>(...parts: string[]): Promise<T | null> {
+/** A JSON file's contents, or null when it's missing or unreadable. */
+async function readJson<T>(text: Promise<string>): Promise<T | null> {
try {
- return JSON.parse(await fs.readFile(path.join(process.cwd(), ...parts), "utf8")) as T;
+ return JSON.parse(await text) as T;
} catch {
return null;
}
@@ -23,7 +24,11 @@ async function readJson<T>(...parts: string[]): Promise<T | null> {
/** Fuobe's version and every open model's licence, from package.json, the ComfyUI manifest and the catalog. */
async function readAbout() {
"use cache";
- const [pkg, manifest] = await Promise.all([readJson<{ version?: string }>("package.json"), readJson<Manifest & { comfyuiVersion?: string }>("workflows", "comfyui", "manifest.json")]);
+ // Each path is spelled out, so the build traces these two files, not the whole project.
+ const [pkg, manifest] = await Promise.all([
+ readJson<{ version?: string }>(fs.readFile(path.join(process.cwd(), "package.json"), "utf8")),
+ readJson<Manifest & { comfyuiVersion?: string }>(fs.readFile(path.join(process.cwd(), "workflows", "comfyui", "manifest.json"), "utf8")),
+ ]);
const workflows = manifest?.workflows ?? [];
return {
version: pkg?.version ?? "dev",
diff --git a/src/server/loras.ts b/src/server/loras.ts
index a54cd49c..293d706e 100644
--- a/src/server/loras.ts
+++ b/src/server/loras.ts
@@ -450,7 +450,7 @@ export function recordTrainedMirror(file: string, target: "fal" | "replicate", u
version: null,
hostedUrl: url,
sha256: own ? sha256File(own) : null,
- sizeBytes: own ? fs.statSync(own).size : null,
+ sizeBytes: own ? fs.statSync(/*turbopackIgnore: true*/ own).size : null,
licence: { own: true },
});
}
@@ -477,7 +477,7 @@ async function sendOwnLora(l: LoraRef, target: "fal" | "replicate", upload: (dat
const local = ownCopy(l.file) ?? inComfy;
if (local) {
onProgress?.(`Sending ${name} to ${target === "fal" ? "fal.ai" : "Replicate"} (once)`);
- const data = fs.readFileSync(local);
+ const data = fs.readFileSync(/*turbopackIgnore: true*/ local);
const hostedUrl = await upload(data, path.basename(l.file));
recordCopy({ file: l.file, target, sourceUrl: `fuobe:${l.file}`, version: null, hostedUrl, sha256: crypto.createHash("sha256").update(data).digest("hex"), sizeBytes: data.length, licence: { own: true } });
return { ...l, hostedUrl };
diff --git a/src/server/training.ts b/src/server/training.ts
index a00a95ee..506bd84f 100644
--- a/src/server/training.ts
+++ b/src/server/training.ts
@@ -569,7 +569,7 @@ export async function attachLora(elementId: string, input: { file: string; trigg
} catch {
src = "";
}
- if (src && fs.existsSync(src)) {
+ if (src && fs.existsSync(/*turbopackIgnore: true*/ src)) {
await keepTrainedLora(file, { path: src });
own = true;
}