add zip vfs

This commit is contained in:
tresabhi committed 2026-11-14 11:16:49 -06:00
1 parent 035e034995
commit 7f80723ee7
4 files changed
+24 -9

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { assertSecret } from "@blitzkit/core";
import { LocalVFS } from "./local";
import { MixedVFS } from "./mixed";
import { ZipVFS } from "./zip";
// zip reads straight from the remote archive; CLIENT_DIR stays first so SmartDLC patches override it
export function createClientVFS() {
const local = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
if (import.meta.env.CLIENT_PROVIDER === "zip") {
return new MixedVFS([
local,
new ZipVFS(assertSecret(import.meta.env.CLIENT_SOURCE)),
]);
}
return local;
}
+2 -3
View File
@@ -3,7 +3,6 @@ import { mkdir, rm } from "node:fs/promises";
import { downloadSteamClient } from "./steam";
import { downloadWGCClient } from "./wgc";
import { downloadWGPKGClient } from "./wgpkg";
import { downloadZipClient } from "./zip";
export const DEPOT_DOWNLOADER_RETRY_TIME = 30_000;
@@ -20,9 +19,9 @@ switch (provider) {
await downloadSteamClient();
break;
// from zip, usually has a root directory for opentest
// from zip, read remotely by ZipVFS at build time; nothing to download
case "zip":
await downloadZipClient();
console.log("Zip client provider; skipping download in favor of ZipVFS");
break;
// effectively the same as wgc, but direct for preview
+2 -3
View File
@@ -1,4 +1,3 @@
import { assertSecret } from "@blitzkit/core";
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
import { createClientVFS } from "@blitzkit/core/src/blitzkit/vfs/client";
export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
export const vfs = createClientVFS();
+2 -3
View File
@@ -1,4 +1,3 @@
import { assertSecret } from "@blitzkit/core";
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
import { createClientVFS } from "@blitzkit/core/src/blitzkit/vfs/client";
export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
export const vfs = createClientVFS();