import "./index.css" import { Title, Meta, Link } from "@solidjs/meta" import { createAsync, query } from "@solidjs/router" import { Header } from "~/component/header" import { Footer } from "~/component/footer" import { Legal } from "~/component/legal" import { config } from "~/config" import { For, Show } from "solid-js" type Release = { tag_name: string name: string body: string published_at: string html_url: string } const getReleases = query(async () => { "use server" const response = await fetch("https://api.github.com/repos/anomalyco/opencode/releases?per_page=20", { headers: { Accept: "application/vnd.github.v3+json", "User-Agent": "OpenCode-Console", }, cf: { cacheTtl: 60 * 5, cacheEverything: true, }, } as any) if (!response.ok) return [] return response.json() as Promise }, "releases.get") function formatDate(dateString: string) { const date = new Date(dateString) return date.toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", }) } type Highlight = { source: string title: string description: string shortDescription?: string image?: { src: string width: string height: string } video?: string } function parseHighlights(body: string): Highlight[] { const highlights: Highlight[] = [] const regex = /([\s\S]*?)<\/highlight>/g let match while ((match = regex.exec(body)) !== null) { const source = match[1] const content = match[2] const titleMatch = content.match(/

([^<]+)<\/h2>/) const pMatch = content.match(/([^<]+)<\/p>/) const imgMatch = content.match(/ { const match = props.item.match(/^(.+?)(\s*\(@([\w-]+)\))?$/) if (match) { return { text: match[1], username: match[3], } } return { text: props.item, username: undefined } } return (
  • {parts().text} (@{parts().username})
  • ) } function HighlightCard(props: { highlight: Highlight }) { return (

    {props.highlight.source}

    {props.highlight.title}

    {props.highlight.description}

    {props.highlight.title}
    ) } export default function Changelog() { const releases = createAsync(() => getReleases()) return (
    OpenCode | Changelog

    Changelog

    New updates and improvements to OpenCode

    {(release) => { const parsed = () => parseMarkdown(release.body || "") return (
    0}>
    {(highlight) => }
    {(section) => (

    {section.title}

      {(item) => }
    )}
    ) }}
    ) }