diff options
| author | David Hill <[email protected]> | 2025-12-12 20:25:21 +0000 |
|---|---|---|
| committer | David Hill <[email protected]> | 2025-12-12 20:25:21 +0000 |
| commit | 642eec3dfd82701ee11fcbb06e93f742ee96bd9d (patch) | |
| tree | 652776d58a39343ba807d937e84c8d13456b3148 /packages | |
| parent | 9b77246246ab0d81aaee23514c343ccb93c36847 (diff) | |
| parent | 73513612d43274095e841b99decbbd05857328ed (diff) | |
| download | opencode-642eec3dfd82701ee11fcbb06e93f742ee96bd9d.tar.gz opencode-642eec3dfd82701ee11fcbb06e93f742ee96bd9d.zip | |
Merge branch 'dev' of https://github.com/sst/opencode into dev
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/console/app/src/lib/github.ts | 1 | ||||
| -rw-r--r-- | packages/console/app/src/routes/download/index.tsx | 19 |
2 files changed, 4 insertions, 16 deletions
diff --git a/packages/console/app/src/lib/github.ts b/packages/console/app/src/lib/github.ts index bc49d2e62..cc266f58c 100644 --- a/packages/console/app/src/lib/github.ts +++ b/packages/console/app/src/lib/github.ts @@ -26,6 +26,7 @@ export const github = query(async () => { release: { name: release.name, url: release.html_url, + tag_name: release.tag_name, }, contributors: contributorCount, } diff --git a/packages/console/app/src/routes/download/index.tsx b/packages/console/app/src/routes/download/index.tsx index 86f266afc..31ce49617 100644 --- a/packages/console/app/src/routes/download/index.tsx +++ b/packages/console/app/src/routes/download/index.tsx @@ -8,20 +8,7 @@ import { Faq } from "~/component/faq" import desktopAppIcon from "../../asset/lander/opencode-desktop-icon.png" import { Legal } from "~/component/legal" import { config } from "~/config" - -const getLatestRelease = query(async () => { - "use server" - const response = await fetch("https://api.github.com/repos/sst/opencode/releases/latest", { - headers: { - "User-Agent": - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", - }, - }) - - if (!response.ok) return null - const data = await response.json() - return data.tag_name as string -}, "latest-release") +import { github } from "~/lib/github" function CopyStatus() { return ( @@ -33,11 +20,11 @@ function CopyStatus() { } export default function Download() { - const release = createAsync(() => getLatestRelease(), { + const githubData = createAsync(() => github(), { deferStream: true, }) const download = () => { - const version = release() + const version = githubData()?.release.tag_name if (!version) return null return `https://github.com/sst/opencode/releases/download/${version}` } |
