From ee2c516279d35f529fd844a0078c1adc845bdf5a Mon Sep 17 00:00:00 2001 From: Research Assistant Date: Thu, 30 Apr 2026 12:59:45 +0800 Subject: [PATCH] chore: update versions.json to v1.4.11; sync script covers both json files --- paperforge/plugin/versions.json | 3 ++- scripts/sync-plugin-version.py | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/paperforge/plugin/versions.json b/paperforge/plugin/versions.json index 5eadcb3e..bba8fa40 100644 --- a/paperforge/plugin/versions.json +++ b/paperforge/plugin/versions.json @@ -1,3 +1,4 @@ { - "1.4.3": "1.0.0" + "1.4.3": "1.0.0", + "1.4.11": "1.0.0" } \ No newline at end of file diff --git a/scripts/sync-plugin-version.py b/scripts/sync-plugin-version.py index f1c6dbd6..6aa45078 100644 --- a/scripts/sync-plugin-version.py +++ b/scripts/sync-plugin-version.py @@ -1,13 +1,29 @@ -"""Sync plugin manifest.json version from paperforge.__version__.""" +"""Sync plugin manifest.json and versions.json from paperforge.__version__. + +Keeps plugin metadata in sync with the single version source in __init__.py. +""" import json from pathlib import Path from paperforge import __version__ -manifest_path = Path(__file__).resolve().parent.parent / "paperforge" / "plugin" / "manifest.json" +plugin_dir = Path(__file__).resolve().parent.parent / "paperforge" / "plugin" + +# manifest.json +manifest_path = plugin_dir / "manifest.json" manifest = json.loads(manifest_path.read_text(encoding="utf-8")) if manifest["version"] != __version__: manifest["version"] = __version__ manifest_path.write_text(json.dumps(manifest, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") print(f"manifest.json: {manifest['version']} -> {__version__}") else: - print(f"manifest.json in sync (v{__version__})") + print(f"manifest.json: OK (v{__version__})") + +# versions.json +vers_path = plugin_dir / "versions.json" +versions = json.loads(vers_path.read_text(encoding="utf-8")) +if __version__ not in versions: + versions[__version__] = "1.0.0" + vers_path.write_text(json.dumps(versions, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + print(f"versions.json: added v{__version__}") +else: + print(f"versions.json: OK (v{__version__})")