mevebu 1.5.0 → 1.5.1

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.
@@ -188,6 +188,9 @@ function openUpdate(latest) {
188
188
  const actionBox = el("div", { class: "flex flex-wrap items-center justify-end gap-2" });
189
189
  const command = updateCommand();
190
190
  const updatable = () => Boolean(resolved) && compareVersions(resolved, VERSION) > 0;
191
+ // A local build can sit above the published one, and saying "up to date" next
192
+ // to a lower number reads as a bug, so that case names itself.
193
+ const ahead = () => Boolean(resolved) && compareVersions(resolved, VERSION) < 0;
191
194
 
192
195
  const versionRow = (label, value, isNew) =>
193
196
  el(
@@ -206,9 +209,11 @@ function openUpdate(latest) {
206
209
  ? "Checking for updates"
207
210
  : newer
208
211
  ? `mevebu ${resolved} is out`
209
- : resolved
210
- ? "mevebu is up to date"
211
- : "Could not check for updates"
212
+ : !resolved
213
+ ? "Could not check for updates"
214
+ : ahead()
215
+ ? "This build is ahead of the published version"
216
+ : "mevebu is up to date"
212
217
  ),
213
218
  newer
214
219
  ? el("p", {}, "A newer version is published. Update your global install, then run ", el("code", { class: CODE }, PACKAGE_NAME), " again.")
@@ -743,7 +743,7 @@ export function blank(iconName, text) {
743
743
  // ---------- version ----------
744
744
 
745
745
  // Kept in one place. The CLI reads the same value from package.json.
746
- export const VERSION = "1.5.0";
746
+ export const VERSION = "1.5.1";
747
747
  export const PACKAGE_NAME = "mevebu";
748
748
  export const REPO_SLUG = "mevebu/mevebu";
749
749
 
@@ -763,7 +763,14 @@ async function getJson(url, timeout) {
763
763
  const controller = new AbortController();
764
764
  const timer = setTimeout(() => controller.abort(), timeout);
765
765
  try {
766
- const response = await fetch(url, { signal: controller.signal, headers: { accept: "application/json" } });
766
+ // The registry answers `/latest` with `max-age=300`, so a cached reply would
767
+ // keep reporting the version from before a publish for five minutes. A
768
+ // version check is worthless when it is stale, so it never reads the cache.
769
+ const response = await fetch(url, {
770
+ signal: controller.signal,
771
+ cache: "no-store",
772
+ headers: { accept: "application/json" },
773
+ });
767
774
  if (!response.ok) return null;
768
775
  return await response.json();
769
776
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mevebu",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Small tools that run in your browser. No accounts, no uploads, no tracking.",
5
5
  "license": "MIT",
6
6
  "type": "module",