A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: proper version detection

+18 -10
+1
deno.jsonc
··· 35 35 "@orama/orama": "npm:@orama/orama@^3.1.18", 36 36 "@phosphor-icons/web": "npm:@phosphor-icons/web@^2.1.2", 37 37 "@std/html": "jsr:@std/html@^1.0.5", 38 + "@std/semver": "jsr:@std/semver@^1.0.8", 38 39 "@vicary/debounce-microtask": "jsr:@vicary/debounce-microtask@^0.1.8", 39 40 "@tanstack/virtual-core": "npm:@tanstack/virtual-core@^3.13.0", 40 41 "alien-signals": "npm:alien-signals@^3.1.2",
+3 -1
src/_includes/layouts/kitchen.vto
··· 22 22 <a href="./" style="display: inline-block;"> 23 23 {{ await comp.diffuse.logo() }} 24 24 </a> 25 - {{ await comp.diffuse.status() }} 25 + <span style="direction: rtl"> 26 + {{ await comp.diffuse.status() }} 27 + </span> 26 28 </div> 27 29 </div> 28 30 {{ await comp.nav({ url, facets }) }}
+14 -9
src/common/pages/version-upgrade.js
··· 1 + import { greaterThan, parse as parseSemver } from "@std/semver"; 2 + 1 3 // Version upgrade (only works with `diffuse-artifacts` deployments) 2 - if (document.location.hostname.endsWith("diffuse.sh")) { 4 + if (true || document.location.hostname.endsWith("diffuse.sh")) { 3 5 document.querySelectorAll("#status").forEach(async (status) => { 4 6 const versionOrCid = 5 7 document.location.pathname.slice(1).split("/")[0]?.toLowerCase() ?? ""; ··· 7 9 const { default: artifacts } = await import( 8 10 `${document.location.origin}/artifacts.json`, 9 11 { with: { type: "json" } } 10 - ); 12 + ).catch(() => ({ default: {} })); 11 13 12 - // Latest is located at the end 13 - const lastArtifact = Object.values(artifacts).reverse()[0]; 14 + // Latest by semver 15 + const lastArtifact = Object.values(artifacts).reduce((max, artifact) => { 16 + if (!max) return artifact; 17 + return greaterThan(parseSemver(artifact.version), parseSemver(max.version)) 18 + ? artifact 19 + : max; 20 + }, null); 14 21 15 22 // Check if using latest 16 - const isLatest = usesCid 23 + const isLatest = !lastArtifact 24 + ? true 25 + : usesCid 17 26 ? versionOrCid === lastArtifact.cid 18 27 : versionOrCid === lastArtifact.version; 19 28 ··· 42 51 document.querySelectorAll("#status a").forEach((el) => { 43 52 el.classList.add("hidden"); 44 53 }); 45 - 46 - // document.querySelectorAll("#status").forEach((status) => { 47 - // status.remove(); 48 - // }); 49 54 }