From 2e4f6239b723285950c9e292753d23cfa8c6039f Mon Sep 17 00:00:00 2001 From: ShinobuTakahashi Date: Tue, 23 Jul 2024 10:52:51 +0900 Subject: [PATCH 1/3] Fix behavior of moduleMainPaths --- src/ModuleManager.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ModuleManager.ts b/src/ModuleManager.ts index 58cb39ab4..ae862c681 100644 --- a/src/ModuleManager.ts +++ b/src/ModuleManager.ts @@ -75,7 +75,6 @@ export class ModuleManager { let resolvedPath: string | undefined; const liveAssetVirtualPathTable = this._assetManager._liveAssetVirtualPathTable; const moduleMainScripts = this._assetManager._moduleMainScripts; - const moduleMainPaths = this._assetManager._moduleMainPaths; // 0. アセットIDらしい場合はまず当該アセットを探す if (path.indexOf("/") === -1) { @@ -96,8 +95,8 @@ export class ModuleManager { } // akashic-engine独自仕様: 対象の `path` が `moduleMainScripts` に指定されていたらそちらを参照する - // moduleMainScripts は将来的に非推奨となるため、moduleMainPaths が存在しない場合だけ参照する - if (!moduleMainPaths && moduleMainScripts[path]) { + // moduleMainScripts は将来的に非推奨となるが、後方互換性のため moduleMainScripts が存在すれば moduleMainScripts を優先する + if (moduleMainScripts[path]) { targetScriptAsset = liveAssetVirtualPathTable[resolvedPath]; } else { targetScriptAsset = this._findAssetByPathAsFile(resolvedPath, liveAssetVirtualPathTable); @@ -147,7 +146,6 @@ export class ModuleManager { let resolvedPath: string | null = null; const liveAssetVirtualPathTable = this._assetManager._liveAssetVirtualPathTable; const moduleMainScripts = this._assetManager._moduleMainScripts; - const moduleMainPaths = this._assetManager._moduleMainPaths; // require(X) from module at path Y // 1. If X is a core module, @@ -183,8 +181,8 @@ export class ModuleManager { // 3. LOAD_NODE_MODULES(X, dirname(Y)) // akashic-engine独自仕様: 対象の `path` が `moduleMainScripts` に指定されていたらそちらを返す - // moduleMainScripts は将来的に非推奨となるため、moduleMainPaths が存在しない場合だけ参照する - if (!moduleMainPaths && moduleMainScripts[path]) { + // moduleMainScripts は将来的に非推奨となるが、後方互換性のため moduleMainScripts が存在すれば moduleMainScripts を優先する + if (moduleMainScripts[path]) { return moduleMainScripts[path]; } From 9de66e0c4a0a96cfc4fb7c3798ac898788f1bda9 Mon Sep 17 00:00:00 2001 From: ShinobuTakahashi Date: Tue, 23 Jul 2024 10:54:33 +0900 Subject: [PATCH 2/3] bump version --- CHANGELOG.md | 3 +++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83a233306..1d55a1615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # ChangeLog +## 3.18.1 +* `moduleMainPaths` の挙動を `moduleMainScripts` が存在しない場合に参照するように修正 + ## 3.18.0 * @akashic/game-configuration@2.2.0 に追従 * `moduleMainPaths` をサポート diff --git a/package-lock.json b/package-lock.json index 037b45e74..634500037 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@akashic/akashic-engine", - "version": "3.18.0", + "version": "3.18.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@akashic/akashic-engine", - "version": "3.18.0", + "version": "3.18.1", "license": "MIT", "dependencies": { "@akashic/game-configuration": "~2.2.0", diff --git a/package.json b/package.json index 0b176ae77..575352676 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@akashic/akashic-engine", - "version": "3.18.0", + "version": "3.18.1", "description": "The core library of Akashic Engine", "main": "index.js", "dependencies": { From de122d21f75f8cda2d326c848edf598b725137de Mon Sep 17 00:00:00 2001 From: ShinobuTakahashi Date: Tue, 23 Jul 2024 13:50:48 +0900 Subject: [PATCH 3/3] Mod CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d55a1615..1c89b27d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # ChangeLog ## 3.18.1 -* `moduleMainPaths` の挙動を `moduleMainScripts` が存在しない場合に参照するように修正 +* `moduleMainPaths` の挙動を `moduleMainScripts` が存在しない場合に利用するように修正 ## 3.18.0 * @akashic/game-configuration@2.2.0 に追従