Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 6f5c66f

Browse files
committed
chore(types): fix errors in website
1 parent 296c95e commit 6f5c66f

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

apps/website/src/lib/download-helper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ export type App = "desktop" | "server";
44

55
export type Architecture = 'x64' | 'arm64';
66

7-
export type Platform = 'macos' | 'windows' | 'linux';
7+
export type Platform = "macos" | "windows" | "linux" | "pikapod";
88

9-
let version = rootPackageJson.version;
9+
const version = rootPackageJson.version;
1010

1111
export interface DownloadInfo {
1212
recommended?: boolean;
@@ -20,7 +20,7 @@ export interface DownloadMatrixEntry {
2020
downloads: Record<string, DownloadInfo>;
2121
}
2222

23-
type DownloadMatrix = Record<App, Record<Platform, DownloadMatrixEntry>>;
23+
type DownloadMatrix = Record<App, { [ P in Platform ]?: DownloadMatrixEntry }>;
2424

2525
// Keep compatibility info inline with https://github.com/electron/electron/blob/main/README.md#platform-support.
2626
export const downloadMatrix: DownloadMatrix = {
@@ -131,7 +131,7 @@ export function buildDownloadUrl(app: App, platform: Platform, format: string, a
131131
if (app === "desktop") {
132132
return `https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNextNotes-v${version}-${platform}-${architecture}.${format}`;
133133
} else if (app === "server") {
134-
return downloadMatrix.server[platform].downloads[format].url ?? "#";
134+
return downloadMatrix.server[platform]?.downloads[format].url ?? "#";
135135
} else {
136136
return "#";
137137
}
@@ -149,7 +149,7 @@ export function getArchitecture(): Architecture {
149149
function getPlatform(): Platform {
150150
const userAgent = navigator.userAgent.toLowerCase();
151151
if (userAgent.includes('macintosh') || userAgent.includes('mac os x')) {
152-
return "mac";
152+
return "macos";
153153
} else if (userAgent.includes('windows') || userAgent.includes('win32')) {
154154
return "windows";
155155
} else {

apps/website/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"skipLibCheck": true,
1010
"sourceMap": true,
1111
"strict": true,
12-
"moduleResolution": "bundler"
12+
"moduleResolution": "bundler",
13+
"composite": true
1314
}
1415
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
1516
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
},
6060
{
6161
"path": "./packages/share-theme"
62+
},
63+
{
64+
"path": "./apps/website"
6265
}
6366
]
6467
}

0 commit comments

Comments
 (0)