@camunda8/cli 3.2.0-alpha.8 → 3.2.0-alpha.9

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.
@@ -57,6 +57,36 @@ export function isRollingVersion(versionSpec) {
57
57
  return isVersionAlias(versionSpec) || isMinorVersionPattern(versionSpec);
58
58
  }
59
59
 
60
+ /**
61
+ * Extract the leading major.minor pair from a version string.
62
+ * Accepts minor patterns ("8.10") and concrete versions ("8.10.0-alpha1").
63
+ * Returns { major, minor } or null if the string has no major.minor prefix.
64
+ */
65
+ export function majorMinorOf(version) {
66
+ const match = /^(\d+)\.(\d+)/.exec(version);
67
+ if (!match) return null;
68
+ return { major: Number(match[1]), minor: Number(match[2]) };
69
+ }
70
+
71
+ /**
72
+ * True when the remote alias target is a strictly newer minor line than the
73
+ * locally resolved version. The remote alias always resolves to a major.minor
74
+ * pattern (e.g. "8.10"), whereas the resolved version may be a concrete pin
75
+ * (e.g. "8.10.0-alpha1") within that same minor line. Comparing the raw
76
+ * strings produces false positives (#434): "8.10" !== "8.10.0-alpha1" even
77
+ * though no newer release exists. Compare at the major.minor level instead.
78
+ */
79
+ export function isRemoteMinorNewer(remoteVersion, resolvedVersion) {
80
+ const remote = majorMinorOf(remoteVersion);
81
+ const resolved = majorMinorOf(resolvedVersion);
82
+ // If either side is unparseable, fall back to the previous behavior (string inequality).
83
+ if (!remote || !resolved) return remoteVersion !== resolvedVersion;
84
+ return (
85
+ remote.major > resolved.major ||
86
+ (remote.major === resolved.major && remote.minor > resolved.minor)
87
+ );
88
+ }
89
+
60
90
  /**
61
91
  * Fetch the c8run download directory listing and discover the latest
62
92
  * stable and alpha minor versions.
@@ -244,7 +274,7 @@ export function checkBackgroundAliasFreshness(versionSpec, resolvedVersion) {
244
274
  if (html) {
245
275
  const remote = parseVersionsFromHtml(html);
246
276
  const remoteVersion = remote?.[versionSpec];
247
- if (remoteVersion && remoteVersion !== resolvedVersion) {
277
+ if (remoteVersion && isRemoteMinorNewer(remoteVersion, resolvedVersion)) {
248
278
  logger.info(
249
279
  `A newer "${versionSpec}" release is available (${remoteVersion}). ` +
250
280
  `Install it with: c8ctl cluster install ${versionSpec}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda8/cli",
3
- "version": "3.2.0-alpha.8",
3
+ "version": "3.2.0-alpha.9",
4
4
  "description": "Camunda 8 CLI - minimal-dependency CLI for Camunda 8 operations",
5
5
  "type": "module",
6
6
  "engines": {