coder-config 0.46.1 → 0.46.3-beta

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.
@@ -19,7 +19,7 @@
19
19
 
20
20
  <!-- PWA Manifest -->
21
21
  <link rel="manifest" href="/manifest.json">
22
- <script type="module" crossorigin src="/assets/index-CP7Pd-AB.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-DCNTqTzf.js"></script>
23
23
  <link rel="stylesheet" crossorigin href="/assets/index-7pv_0wlM.css">
24
24
  </head>
25
25
  <body>
@@ -142,20 +142,34 @@ function fetchNpmVersion(channel = 'stable') {
142
142
 
143
143
  /**
144
144
  * Check if source is newer version
145
+ * Handles versions like: 0.46.1, 0.46.2-beta
146
+ * Beta versions are considered older than same number stable (0.46.2-beta < 0.46.2)
145
147
  */
146
148
  function isNewerVersion(source, installed) {
147
149
  if (!source || !installed) return false;
150
+ if (source === installed) return false; // Exact match - no update needed
151
+
152
+ // Parse version: "0.46.2-beta" -> { major: 0, minor: 46, patch: 2, beta: true }
153
+ const parseVersion = (v) => {
154
+ const isBeta = v.includes('-beta');
155
+ const clean = v.replace('-beta', '');
156
+ const parts = clean.split('.').map(n => parseInt(n, 10) || 0);
157
+ return { major: parts[0], minor: parts[1], patch: parts[2], beta: isBeta };
158
+ };
148
159
 
149
- const parseVersion = (v) => v.split('.').map(n => parseInt(n, 10) || 0);
150
160
  const s = parseVersion(source);
151
161
  const i = parseVersion(installed);
152
162
 
153
- for (let j = 0; j < Math.max(s.length, i.length); j++) {
154
- const sv = s[j] || 0;
155
- const iv = i[j] || 0;
156
- if (sv > iv) return true;
157
- if (sv < iv) return false;
158
- }
163
+ // Compare major.minor.patch first
164
+ if (s.major !== i.major) return s.major > i.major;
165
+ if (s.minor !== i.minor) return s.minor > i.minor;
166
+ if (s.patch !== i.patch) return s.patch > i.patch;
167
+
168
+ // Same version number - beta is older than stable
169
+ // source=stable, installed=beta -> newer (true)
170
+ // source=beta, installed=stable -> older (false)
171
+ // source=beta, installed=beta -> same (false)
172
+ if (!s.beta && i.beta) return true;
159
173
  return false;
160
174
  }
161
175