@dcl-regenesislabs/opendcl 0.1.0 → 0.1.1-22314251678.commit-6fa4bb7
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.
|
@@ -49,18 +49,31 @@ export async function fetchLatestVersion(): Promise<string | null> {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/** Strip pre-release and build metadata from a version string (e.g. "1.0.0-beta" -> "1.0.0"). */
|
|
53
|
+
function stripPreRelease(version: string): string {
|
|
54
|
+
return version.replace(/[-+].*$/, "");
|
|
55
|
+
}
|
|
56
|
+
|
|
52
57
|
/** Compare two semver strings. Returns true if latest is newer than current. */
|
|
53
58
|
export function isNewerVersion(current: string, latest: string): boolean {
|
|
54
|
-
const
|
|
55
|
-
const
|
|
59
|
+
const currentBase = stripPreRelease(current);
|
|
60
|
+
const latestBase = stripPreRelease(latest);
|
|
61
|
+
|
|
62
|
+
const currentParts = currentBase.split(".").map((n) => parseInt(n, 10) || 0);
|
|
63
|
+
const latestParts = latestBase.split(".").map((n) => parseInt(n, 10) || 0);
|
|
56
64
|
const length = Math.max(currentParts.length, latestParts.length);
|
|
65
|
+
|
|
57
66
|
for (let i = 0; i < length; i++) {
|
|
58
67
|
const currentPart = currentParts[i] || 0;
|
|
59
68
|
const latestPart = latestParts[i] || 0;
|
|
60
69
|
if (latestPart > currentPart) return true;
|
|
61
70
|
if (latestPart < currentPart) return false;
|
|
62
71
|
}
|
|
63
|
-
|
|
72
|
+
|
|
73
|
+
// Base versions equal: pre-release < stable (e.g., 0.1.0-snapshot < 0.1.0)
|
|
74
|
+
const currentHasPreRelease = current !== currentBase;
|
|
75
|
+
const latestHasPreRelease = latest !== latestBase;
|
|
76
|
+
return currentHasPreRelease && !latestHasPreRelease;
|
|
64
77
|
}
|
|
65
78
|
|
|
66
79
|
const extension: ExtensionFactory = (pi) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl-regenesislabs/opendcl",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1-22314251678.commit-6fa4bb7",
|
|
4
4
|
"description": "AI coding assistant for Decentraland SDK7 scene development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"prompts/",
|
|
62
62
|
"context/"
|
|
63
63
|
],
|
|
64
|
-
"commit": "
|
|
64
|
+
"commit": "6fa4bb7ed533a02481bef6f5b838a59915329baa"
|
|
65
65
|
}
|