diff --git a/README.md b/README.md index 978d096..1a66ae6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ npm test npm run build ``` -The production entry is generated as `js/korean_comments_action-main.mjs`. `Util::addInitScript(Application::APP_ID, 'main')` resolves that app-prefixed asset. +The production entry is generated as `js/korean_comments_action-main.mjs`. The listener therefore calls `Util::addInitScript(Application::APP_ID, Application::APP_ID . '-main')`; passing only `'main'` would incorrectly resolve the nonexistent `js/main.mjs`. ## Deployment commands (not run during this investigation) @@ -29,6 +29,8 @@ Copy the app directory to `/data/nextcloud/app/custom_apps/korean_comments_actio php occ app:enable korean_comments_action ``` +The app declares the `filesystem` type so its Files event listener is registered early. When upgrading from a build that lacked this type, disable and re-enable the app once so Nextcloud refreshes the persisted app type before restarting the app container. + Disable/rollback with: ```bash diff --git a/appinfo/info.xml b/appinfo/info.xml index a481178..3a928e9 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,10 +5,13 @@ Korean comments action Adds a 댓글 action to the Files row menu Adds a Korean-labeled file action that opens the Activity/comments sidebar. - 1.0.0 + 1.0.1 agpl Hera (헤라) KoreanCommentsAction + + + files diff --git a/js/korean_comments_action-main.mjs.license b/js/korean_comments_action-main.mjs.license index 09949cf..f1ac367 100644 --- a/js/korean_comments_action-main.mjs.license +++ b/js/korean_comments_action-main.mjs.license @@ -138,7 +138,7 @@ This file is generated from multiple sources. Included packages: - version: 1.1.15 - license: MIT - korean-comments-action - - version: 1.0.0 + - version: 1.0.1 - license: undefined - math-intrinsics - version: 1.1.0 diff --git a/lib/Listener/LoadFilesScript.php b/lib/Listener/LoadFilesScript.php index 5d999be..d1c2b18 100644 --- a/lib/Listener/LoadFilesScript.php +++ b/lib/Listener/LoadFilesScript.php @@ -17,6 +17,6 @@ final class LoadFilesScript implements IEventListener { return; } - Util::addInitScript(Application::APP_ID, 'main'); + Util::addInitScript(Application::APP_ID, Application::APP_ID . '-main'); } } diff --git a/package-lock.json b/package-lock.json index 2a1d75d..ecf1452 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "korean-comments-action", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "korean-comments-action", - "version": "1.0.0", + "version": "1.0.1", "dependencies": { "@nextcloud/files": "4.0.0", "@nextcloud/initial-state": "3.0.0" diff --git a/package.json b/package.json index 3f89fd6..72081f8 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "korean-comments-action", - "version": "1.0.0", + "version": "1.0.1", "private": true, "type": "module", "scripts": { "build": "vite build", "typecheck": "tsc --noEmit", - "test": "vitest run" + "test": "python3 tests/check_php_asset.py && vitest run" }, "dependencies": { "@nextcloud/files": "4.0.0", diff --git a/tests/check_php_asset.py b/tests/check_php_asset.py new file mode 100644 index 0000000..cd17b5d --- /dev/null +++ b/tests/check_php_asset.py @@ -0,0 +1,10 @@ +from pathlib import Path + +root = Path(__file__).resolve().parents[1] +listener = (root / "lib/Listener/LoadFilesScript.php").read_text() +expected_call = "Util::addInitScript(Application::APP_ID, Application::APP_ID . '-main');" + +assert expected_call in listener, "listener must load the exact app-prefixed Vite asset" +assert (root / "js/korean_comments_action-main.mjs").is_file(), "built module is missing" + +print("php asset link ok")