From 90204ac0ac9923ee58c81b4edba015446f09623d Mon Sep 17 00:00:00 2001 From: Exelo Date: Mon, 10 Nov 2025 07:36:27 +0100 Subject: [PATCH 1/2] feat: enable auto-fix on save for ESLint and Prettier in IDE settings --- .idea/jsLinters/eslint.xml | 6 ++++++ .idea/prettier.xml | 1 + 2 files changed, 7 insertions(+) create mode 100644 .idea/jsLinters/eslint.xml diff --git a/.idea/jsLinters/eslint.xml b/.idea/jsLinters/eslint.xml new file mode 100644 index 0000000..541945b --- /dev/null +++ b/.idea/jsLinters/eslint.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml index b0c1c68..0c83ac4 100644 --- a/.idea/prettier.xml +++ b/.idea/prettier.xml @@ -2,5 +2,6 @@ \ No newline at end of file From e24326d1c19278de451a67229a5a97201c9ee858 Mon Sep 17 00:00:00 2001 From: Exelo Date: Mon, 10 Nov 2025 07:36:48 +0100 Subject: [PATCH 2/2] fix: simplify `IGameOptions` and streamline file loading logic --- apps/web/src/index.html | 2 +- apps/web/src/loader/loader.ts | 16 +++------------- apps/web/src/types/game.type.ts | 6 +----- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/apps/web/src/index.html b/apps/web/src/index.html index bc65100..fcb9ca3 100644 --- a/apps/web/src/index.html +++ b/apps/web/src/index.html @@ -5,7 +5,7 @@ Title - +
diff --git a/apps/web/src/loader/loader.ts b/apps/web/src/loader/loader.ts index d8efecb..2663118 100644 --- a/apps/web/src/loader/loader.ts +++ b/apps/web/src/loader/loader.ts @@ -8,26 +8,16 @@ const logger = new Logger("Loader"); export const loadGameFiles = async ( manifest: IExtendedManifest, ): Promise<[IGameOptions["files"], any]> => { - const files = { - assets: new Map(), - wasm: new Map(), - wgsl: new Map(), - }; + const files = new Map(); let mainModule = undefined; logger.info("Starting load game files from cache"); for (const file of manifest.files) { - if (file.path.endsWith(".js")) { + if (file.path === "index.js") { const resModule = await loadScript(file); if (resModule) mainModule = resModule; continue; } - if (file.path.endsWith(".wasm")) { - files.wasm.set(file.path, file.localPath); - } else if (file.path.endsWith(".wgsl")) { - files.wgsl.set(file.path, file.localPath); - } else { - files.assets.set(file.path, file.localPath); - } + files.set(file.path, file.localPath); } if (!mainModule) throw new Error("Could not find main function"); logger.info("Game files loaded"); diff --git a/apps/web/src/types/game.type.ts b/apps/web/src/types/game.type.ts index 2cb5425..0b96b84 100644 --- a/apps/web/src/types/game.type.ts +++ b/apps/web/src/types/game.type.ts @@ -1,8 +1,4 @@ export interface IGameOptions { canvas: HTMLCanvasElement; - files: { - assets: Map; - wasm: Map; - wgsl: Map; - }; + files: Map; }