feat(client): Version helper + sync-version script; project.godot config/version

- Add scripts/sync-version to sync root /VERSION into client/project.godot
- Add Version GDScript helper (reads application/config/version)
- Test coverage: 2 tests for Version.string() and footer()
- Synced config/version="0.01-alpha" to project.godot

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-11 10:36:42 -05:00
parent 56278a4831
commit 263254346d
6 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
class_name Version
extends RefCounted
## The client's view of the single source of truth (/VERSION, charter §4). The
## value is baked into project.godot's application/config/version by
## scripts/sync-version on each bump; read it via ProjectSettings so an exported
## build (which has no repo-root /VERSION) still knows its own version.
const SETTING := "application/config/version"
const LAST_RESORT := "0.0.0-dev"
func string() -> String:
var v := str(ProjectSettings.get_setting(SETTING, ""))
return v if v != "" else LAST_RESORT
func footer() -> String:
return "v%s · BUILT IN GODOT 4.7 · © 2026" % string()