diff --git a/bun.lock b/bun.lock index 73b200941..22cfe2bfd 100644 --- a/bun.lock +++ b/bun.lock @@ -30,7 +30,7 @@ "@octokit/plugin-throttling": "^11.0.1", "@octokit/rest": "^22.0.0", "@types/adm-zip": "^0.5.7", - "@types/bun": "^1.3.1", + "@types/bun": "^1.3.14", "@types/lodash-es": "^4.17.12", "@types/lz4js": "^0.2.1", "@types/three": "^0.180.0", diff --git a/packages/core/package.json b/packages/core/package.json index 540a568ee..d7e3bf264 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -9,7 +9,7 @@ "@octokit/plugin-throttling": "^11.0.1", "@octokit/rest": "^22.0.0", "@types/adm-zip": "^0.5.7", - "@types/bun": "^1.3.1", + "@types/bun": "^1.3.14", "@types/lodash-es": "^4.17.12", "@types/lz4js": "^0.2.1", "@types/three": "^0.180.0", diff --git a/packages/core/src/blitzkit/vfs/abstract.ts b/packages/core/src/blitzkit/vfs/abstract.ts index e4f9a0cb3..ea69982d3 100644 --- a/packages/core/src/blitzkit/vfs/abstract.ts +++ b/packages/core/src/blitzkit/vfs/abstract.ts @@ -46,7 +46,15 @@ export abstract class AbstractVFS { return buffer; } - abstract dir(path: string): Promise; + protected abstract _dir(path: string): Promise; + + async dir(path: string) { + const files = await this._dir(path); + + return files.map((file) => + file.endsWith(".dvpl") ? file.slice(0, -5) : file, + ); + } async text(path: string) { const file = await this.file(path); @@ -63,7 +71,7 @@ export abstract class AbstractVFS { return this.xmlParser.parse(file) as Type; } - async _csv(text: string, options: Options = {}) { + protected async _csv(text: string, options: Options = {}) { const parsed = parseCSV(text, options); return parsed; } diff --git a/packages/core/src/blitzkit/vfs/local.ts b/packages/core/src/blitzkit/vfs/local.ts index 0d2fa18ae..c82510048 100644 --- a/packages/core/src/blitzkit/vfs/local.ts +++ b/packages/core/src/blitzkit/vfs/local.ts @@ -23,7 +23,7 @@ export class LocalVFS extends AbstractVFS { return array; } - async dir(path: string) { + async _dir(path: string) { try { return await readdir(`${this.base}/${path}`); } catch (_) { diff --git a/packages/core/src/blitzkit/vfs/mixed.ts b/packages/core/src/blitzkit/vfs/mixed.ts index 1d3358ddb..d510e4115 100644 --- a/packages/core/src/blitzkit/vfs/mixed.ts +++ b/packages/core/src/blitzkit/vfs/mixed.ts @@ -35,7 +35,7 @@ export class MixedVFS extends AbstractVFS { throw new Error(`File not found: ${path}`); } - async dir(path: string) { + async _dir(path: string) { const files = new Set(); for (const vfs of this.vfses) { diff --git a/packages/core/src/blitzkit/vfs/steam.ts b/packages/core/src/blitzkit/vfs/steam.ts index 79acd450d..9ab2c5047 100644 --- a/packages/core/src/blitzkit/vfs/steam.ts +++ b/packages/core/src/blitzkit/vfs/steam.ts @@ -89,7 +89,7 @@ export class SteamVFS extends AbstractVFS { return new Uint8Array(downloaded.file); } - async dir(path: string) { + async _dir(path: string) { const parentSegments = path.split("/").length; const children = new Set(); diff --git a/packages/core/src/blitzkit/vfs/zip.ts b/packages/core/src/blitzkit/vfs/zip.ts index e181df62a..53d3e2856 100644 --- a/packages/core/src/blitzkit/vfs/zip.ts +++ b/packages/core/src/blitzkit/vfs/zip.ts @@ -33,7 +33,7 @@ export class ZipVFS extends AbstractVFS { return new Uint8Array(arrayBuffer); } - async dir(path: string) { + async _dir(path: string) { const parentSegments = path.split("/").length; const children = new Set();