Skip to content

Commit eac7829

Browse files
committed
Update files
1 parent 4961149 commit eac7829

5 files changed

Lines changed: 202 additions & 182 deletions

File tree

‎apps/docs/app/[lang]/download/page.tsx‎

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import Link from 'next/link';
22
import {
33
Container,
44
Boxes,
5-
ServerCog,
65
Terminal,
76
Globe,
87
Code2,
98
Network,
109
Bot,
1110
ShieldCheck,
1211
ArrowRight,
12+
GitBranch,
1313
} from 'lucide-react';
1414
import { HomeLayout } from 'fumadocs-ui/layouts/home';
1515
import { baseOptions } from '@/lib/layout.shared';
@@ -21,7 +21,7 @@ import {
2121
} from '@/lib/download-i18n';
2222
import { PlatformCard } from '@/components/download/platform-card';
2323
import { CommandTabsClient } from '@/components/download/command-tabs-client';
24-
import { DownloadTable } from '@/components/download/download-table';
24+
import { DesktopDownloadTable } from '@/components/download/download-table';
2525
import { ClientCard } from '@/components/download/client-card';
2626
import { OsDetectHero } from '@/components/download/os-detect';
2727

@@ -34,10 +34,9 @@ export default async function DownloadPage({
3434
const t = getDownloadTranslations(lang);
3535

3636
const cliTabs = [
37-
{ key: 'macos', label: t.cli.tabs.macos, commands: CLI_INSTALLS.macos },
38-
{ key: 'linux', label: t.cli.tabs.linux, commands: CLI_INSTALLS.linux },
39-
{ key: 'windows', label: t.cli.tabs.windows, commands: CLI_INSTALLS.windows },
4037
{ key: 'npm', label: t.cli.tabs.npm, commands: CLI_INSTALLS.npm },
38+
{ key: 'pnpm', label: t.cli.tabs.pnpm, commands: CLI_INSTALLS.pnpm },
39+
{ key: 'yarn', label: t.cli.tabs.yarn, commands: CLI_INSTALLS.yarn },
4140
];
4241

4342
return (
@@ -103,14 +102,14 @@ export default async function DownloadPage({
103102
copiedLabel={t.copy.copied}
104103
/>
105104
<PlatformCard
106-
icon={<ServerCog className="h-6 w-6" />}
107-
title={t.server.binary.title}
108-
tagline={t.server.binary.tagline}
109-
description={t.server.binary.description}
110-
command={SERVER_COMMANDS.binary}
105+
icon={<GitBranch className="h-6 w-6" />}
106+
title={t.server.source.title}
107+
tagline={t.server.source.tagline}
108+
description={t.server.source.description}
109+
command={SERVER_COMMANDS.source}
111110
commandLabel="shell"
112-
cta={t.server.binary.cta}
113-
href={t.server.binary.href}
111+
cta={t.server.source.cta}
112+
href={t.server.source.href}
114113
copyLabel={t.copy.copy}
115114
copiedLabel={t.copy.copied}
116115
/>
@@ -132,21 +131,16 @@ export default async function DownloadPage({
132131
copyLabel={t.copy.copy}
133132
copiedLabel={t.copy.copied}
134133
/>
134+
<p className="mt-3 text-xs text-foreground/50 text-center">{t.cli.requires}</p>
135+
</section>
135136

136-
<div className="mt-10">
137-
<DownloadTable
138-
heading={t.cli.manual.heading}
139-
cols={{
140-
arch: t.cli.manual.arch,
141-
file: t.cli.manual.file,
142-
size: t.cli.manual.size,
143-
sha: t.cli.manual.sha,
144-
}}
145-
shaHref={t.verify.checksumsHref}
146-
shaLabel={t.verify.checksumsCta}
147-
/>
148-
<p className="mt-3 text-xs text-foreground/50 text-center">{t.cli.verifyHint}</p>
149-
</div>
137+
{/* Desktop installers */}
138+
<section className="w-full px-4 pb-20 max-w-5xl">
139+
<DesktopDownloadTable
140+
heading={t.desktop.heading}
141+
subheading={t.desktop.subheading}
142+
cols={t.desktop.cols}
143+
/>
150144
</section>
151145

152146
{/* Clients / SDKs */}
@@ -220,10 +214,10 @@ export default async function DownloadPage({
220214
<p className="text-sm text-foreground/70 leading-relaxed mb-4">{t.verify.body}</p>
221215
<div className="flex flex-wrap gap-2">
222216
<Link
223-
href={t.verify.checksumsHref}
217+
href={t.verify.releaseHref}
224218
className="inline-flex h-9 items-center rounded-md border border-border bg-card/60 px-3 text-xs font-medium hover:bg-accent transition-colors"
225219
>
226-
{t.verify.checksumsCta} ↗
220+
{t.verify.releaseCta} ↗
227221
</Link>
228222
<Link
229223
href={t.verify.signingHref}

‎apps/docs/components/download/download-table.tsx‎

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
import Link from 'next/link';
22
import { Download } from 'lucide-react';
3-
import { MANUAL_DOWNLOADS } from '@/lib/download-i18n';
3+
import { DESKTOP_DOWNLOADS } from '@/lib/download-i18n';
44

5-
interface DownloadTableProps {
5+
interface DesktopDownloadTableProps {
66
heading: string;
7-
cols: { arch: string; file: string; size: string; sha: string };
8-
shaHref: string;
9-
shaLabel: string;
7+
subheading: string;
8+
cols: { platform: string; file: string; size: string };
109
}
1110

12-
export function DownloadTable({ heading, cols, shaHref, shaLabel }: DownloadTableProps) {
11+
/**
12+
* Lists every desktop installer published in the latest `one-v*` release.
13+
* Rows are sourced from DESKTOP_DOWNLOADS, which must stay in sync with
14+
* `.github/workflows/one.yml`'s `Upload artifacts` step.
15+
*/
16+
export function DesktopDownloadTable({ heading, subheading, cols }: DesktopDownloadTableProps) {
1317
return (
1418
<div className="rounded-2xl border border-border/70 bg-card/40 overflow-hidden">
15-
<div className="flex items-center justify-between gap-4 border-b border-border/60 px-5 py-3">
19+
<div className="border-b border-border/60 px-5 py-3">
1620
<h3 className="text-sm font-semibold">{heading}</h3>
17-
<Link
18-
href={shaHref}
19-
className="text-xs text-foreground/60 hover:text-foreground transition-colors"
20-
>
21-
{shaLabel} ↗
22-
</Link>
21+
<p className="mt-0.5 text-xs text-foreground/60">{subheading}</p>
2322
</div>
2423
<div className="overflow-x-auto">
2524
<table className="w-full text-sm">
2625
<thead>
2726
<tr className="text-left text-xs uppercase tracking-wider text-foreground/50">
28-
<th className="px-5 py-2 font-medium">{cols.arch}</th>
27+
<th className="px-5 py-2 font-medium">{cols.platform}</th>
2928
<th className="px-5 py-2 font-medium">{cols.file}</th>
3029
<th className="px-5 py-2 font-medium text-right">{cols.size}</th>
3130
<th className="px-5 py-2 font-medium text-right">{''}</th>
3231
</tr>
3332
</thead>
3433
<tbody>
35-
{MANUAL_DOWNLOADS.map((d) => (
36-
<tr key={`${d.os}-${d.arch}`} className="border-t border-border/40 hover:bg-accent/30">
34+
{DESKTOP_DOWNLOADS.map((d) => (
35+
<tr
36+
key={`${d.os}-${d.arch}-${d.kind}`}
37+
className="border-t border-border/40 hover:bg-accent/30"
38+
>
3739
<td className="px-5 py-2.5 whitespace-nowrap">
3840
<span className="font-medium">{d.os}</span>{' '}
3941
<span className="text-foreground/50 text-xs">{d.arch}</span>
@@ -45,7 +47,7 @@ export function DownloadTable({ heading, cols, shaHref, shaLabel }: DownloadTabl
4547
href={d.href}
4648
className="inline-flex items-center gap-1 text-primary hover:underline text-xs font-medium"
4749
>
48-
<Download className="h-3.5 w-3.5" /> .tar.gz
50+
<Download className="h-3.5 w-3.5" />.{d.kind}
4951
</Link>
5052
</td>
5153
</tr>

‎apps/docs/components/download/os-detect.tsx‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
44
import Link from 'next/link';
55
import { Apple, Monitor, ArrowRight } from 'lucide-react';
66
import type { OsKey } from '@/lib/download-i18n';
7-
import { MANUAL_DOWNLOADS } from '@/lib/download-i18n';
7+
import { recommendedDownload } from '@/lib/download-i18n';
88
import { cn } from '@/lib/utils';
99

1010
interface OsDetectHeroProps {
@@ -45,12 +45,7 @@ function detectArch(os: OsKey): 'arm64' | 'x64' {
4545
}
4646

4747
function downloadFor(os: OsKey, arch: 'arm64' | 'x64') {
48-
const wanted = os === 'macos' ? 'macOS' : os === 'linux' ? 'Linux' : 'Windows';
49-
return (
50-
MANUAL_DOWNLOADS.find((d) => d.os === wanted && d.arch === arch) ??
51-
MANUAL_DOWNLOADS.find((d) => d.os === wanted) ??
52-
null
53-
);
48+
return recommendedDownload(os, arch);
5449
}
5550

5651
export function OsDetectHero({

0 commit comments

Comments
 (0)