diff --git a/package.json b/package.json index 184d5c9a..1c66c4f5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vrct", "private": true, - "version": "0.0.0", + "version": "3.3.2", "type": "module", "scripts": { "setup-python": "install.bat", @@ -14,14 +14,15 @@ "tauri-dev": "tauri dev", "task-kill": "python task_kill.py", "clean": "python clean.py", - "dev": "npm run task-kill && npm run build-python && npm run dev-ui", - "dev-cuda": "npm run task-kill && npm run build-python-cuda && npm run dev-ui", - "dev-ui": "npm-run-all --parallel vite tauri-dev", - "build": "npm run clean && npm run build-python && npm run vite-build && npm run tauri build", - "build-cuda": "npm run clean && npm run build-python-cuda && npm run vite-build && npm run tauri build", - "release": "npm run build && python zip.py --zip_name VRCT.zip", - "release-cuda": "npm run build-cuda && python zip.py --zip_name VRCT_cuda.zip", - "release-all": "npm run release && npm run release-cuda" + "update-version": "python update_version.py", + "dev": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run dev-ui", + "dev-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run dev-ui", + "dev-ui": "npm run task-kill && npm-run-all --parallel vite tauri-dev", + "build": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run vite-build && npm run tauri build", + "build-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run vite-build && npm run tauri build", + "release": "npm run update-version && npm run build && python zip.py --zip_name VRCT.zip", + "release-cuda": "npm run update-version && npm run build-cuda && python zip.py --zip_name VRCT_cuda.zip", + "release-all": "npm run update-version && npm run release && npm run release-cuda" }, "dependencies": { "@babel/standalone": "7.27.0", diff --git a/src-python/config.py b/src-python/config.py index 3a3e7c3b..cc53ab16 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -736,7 +736,7 @@ class Config: def init_config(self): # Read Only - self._VERSION = "3.3.1" + self._VERSION = "0.0.0" if getattr(sys, 'frozen', False): self._PATH_LOCAL = os_path.dirname(sys.executable) else: diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 10b04d98..0bbba778 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "VRCT", - "version": "3.3.1", + "version": "0.0.0", "identifier": "com.vrct.app", "build": { "beforeDevCommand": "", @@ -11,20 +11,25 @@ }, "app": { "enableGTKAppId": false, - "windows": [{ - "title": "VRCT", - "center": true, - "width": 450, - "height": 220, - "minWidth": 400, - "minHeight": 200, - "transparent": true, - "decorations": false, - "shadow": false - }], + "windows": [ + { + "title": "VRCT", + "center": true, + "width": 450, + "height": 220, + "minWidth": 400, + "minHeight": 200, + "transparent": true, + "decorations": false, + "shadow": false + } + ], "security": { "csp": null, - "capabilities": ["default", "vrct-capability"] + "capabilities": [ + "default", + "vrct-capability" + ] } }, "bundle": { @@ -56,4 +61,4 @@ } } } -} +} \ No newline at end of file diff --git a/update_version.py b/update_version.py new file mode 100644 index 00000000..38b11a1a --- /dev/null +++ b/update_version.py @@ -0,0 +1,39 @@ +import json +from pathlib import Path + +def update_versions(): + root = Path(__file__).parent + + # package.jsonからバージョンを読み取る + with open(root / "package.json", "r", encoding="utf-8") as f: + package_json = json.load(f) + version = package_json["version"] + + # tauri.conf.jsonを更新 + tauri_conf_path = root / "src-tauri" / "tauri.conf.json" + with open(tauri_conf_path, "r", encoding="utf-8") as f: + tauri_conf = json.load(f) + + tauri_conf["version"] = version + + with open(tauri_conf_path, "w", encoding="utf-8") as f: + json.dump(tauri_conf, f, indent=4, ensure_ascii=False) + + # config.pyを更新 + config_path = root / "src-python" / "config.py" + with open(config_path, "r", encoding="utf-8") as f: + content = f.read() + + # VERSION行を置換 + import re + pattern = r'(self\._VERSION = ")[^"]+(")' + replacement = rf'\g<1>{version}\g<2>' + new_content = re.sub(pattern, replacement, content) + + with open(config_path, "w", encoding="utf-8") as f: + f.write(new_content) + + print(f"✓ バージョン {version} に更新しました") + +if __name__ == "__main__": + update_versions() \ No newline at end of file