@danhachuel/thunderbolt 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hermes_ui/update_manager.py +14 -0
- package/package.json +1 -1
|
@@ -31,9 +31,23 @@ class VersionCheck:
|
|
|
31
31
|
|
|
32
32
|
@property
|
|
33
33
|
def update_available(self) -> bool:
|
|
34
|
+
latest_key = _version_key(self.latest_version)
|
|
35
|
+
current_key = _version_key(self.current_version)
|
|
36
|
+
if latest_key is not None and current_key is not None:
|
|
37
|
+
return latest_key > current_key
|
|
34
38
|
return bool(self.latest_version and self.current_version and self.latest_version != self.current_version)
|
|
35
39
|
|
|
36
40
|
|
|
41
|
+
def _version_key(value: str) -> tuple[int, int, int] | None:
|
|
42
|
+
"""Return a numeric SemVer core so zero-padded patches compare correctly."""
|
|
43
|
+
raw = str(value or "").strip().lstrip("v")
|
|
44
|
+
core = raw.split("+", 1)[0].split("-", 1)[0]
|
|
45
|
+
parts = core.split(".")
|
|
46
|
+
if len(parts) != 3 or not all(part.isdigit() for part in parts):
|
|
47
|
+
return None
|
|
48
|
+
return tuple(int(part) for part in parts) # type: ignore[return-value]
|
|
49
|
+
|
|
50
|
+
|
|
37
51
|
@dataclass(frozen=True)
|
|
38
52
|
class UpdateResult:
|
|
39
53
|
"""Sanitised result of an explicit local package update request."""
|
package/package.json
CHANGED