Skip to content

Commit daa308d

Browse files
author
Kevin Arthur
committed
fix(website): verify Arch install guidance against package
1 parent 1eb7469 commit daa308d

2 files changed

Lines changed: 28 additions & 10 deletions

File tree

‎apps/website/src/pages/download.astro‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ function analyticsArchitecture(arch: string): 'x64' | 'arm64' | 'unknown' {
7171
return 'unknown';
7272
}
7373
74+
function formatReleaseDate(dateStr: string | null | undefined): string {
75+
if (!dateStr) return '';
76+
// releaseDate is a calendar day (CHANGELOG, else America/Vancouver of the
77+
// pipeline timestamp). Format it as UTC midnight so a date-only string does
78+
// not shift with the viewer's local timezone.
79+
const parsed = new Date(`${dateStr}T00:00:00Z`);
80+
if (Number.isNaN(parsed.getTime())) return dateStr;
81+
return parsed.toLocaleDateString('en-US', {
82+
year: 'numeric',
83+
month: 'long',
84+
day: 'numeric',
85+
timeZone: 'UTC',
86+
});
87+
}
88+
7489
function architectureLabel(arch: string): string {
7590
const normalized = arch.toLowerCase();
7691
if (normalized.includes('arm') || normalized.includes('aarch')) return 'ARM64';
@@ -773,7 +788,7 @@ const allSigned = osSignable.length > 0 && osSignable.every((p) => p.trust.signe
773788
<div class="release-info">
774789
<h3>This release</h3>
775790
<p><strong>Version:</strong> {release.version}</p>
776-
<p><strong>Released:</strong> {release.releaseDate}</p>
791+
<p><strong>Released:</strong> {formatReleaseDate(release.releaseDate)}</p>
777792
<p><strong>Channel:</strong> {channelLabel}</p>
778793
<p>
779794
<a href={release.releaseUrl} target="_blank" rel="noopener noreferrer">

‎apps/website/src/test/download-copy.test.ts‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ import { describe, expect, it } from 'vitest';
44
const page = fs.readFileSync(new URL('../pages/download.astro', import.meta.url), 'utf8');
55

66
describe('download page install routes', () => {
7-
it('does not recommend an unpublished Arch PKGBUILD or AUR package', () => {
8-
expect(page).not.toMatch(/PKGBUILD <span class="format-badge">recommended<\/span>/);
9-
expect(page).not.toMatch(/makepkg -si/);
10-
expect(page).not.toMatch(/packaging\/aur\/varve-desktop-bin/);
11-
expect(page).not.toMatch(/An AUR package is coming/);
12-
expect(page).not.toMatch(/AUR registration is currently closed/);
13-
expect(page).not.toMatch(/AUR\/Arch is fixed/);
14-
expect(page).not.toMatch(/is fixed and fine to use/);
15-
expect(page).not.toMatch(/the repository PKGBUILD is fine to use/);
7+
it('documents the tracked Arch PKGBUILD without claiming an AUR package is published', () => {
8+
const pkgbuild = fs.readFileSync(
9+
new URL('../../../../packaging/aur/varve-desktop-bin/PKGBUILD', import.meta.url),
10+
'utf8',
11+
);
12+
expect(pkgbuild).toContain('pkgname=varve-desktop-bin');
13+
expect(page).toMatch(/PKGBUILD <span class="format-badge">recommended<\/span>/);
14+
expect(page).toMatch(/makepkg -si/);
15+
expect(page).toMatch(/packaging\/aur\/varve-desktop-bin/);
16+
expect(page).toMatch(/An AUR package is coming/);
17+
expect(page).toMatch(/AUR registration is currently closed/);
18+
expect(page).not.toMatch(/AUR package is available/);
1619
});
1720

1821
it('formats the stored calendar date without a local timezone shift', () => {

0 commit comments

Comments
 (0)