From 6f5c66f3243a2200b4d00a18400ecb53cb89803f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 14 Jun 2025 23:40:41 +0300 Subject: [PATCH] chore(types): fix errors in website --- apps/website/src/lib/download-helper.ts | 10 +++++----- apps/website/tsconfig.json | 3 ++- tsconfig.json | 3 +++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/website/src/lib/download-helper.ts b/apps/website/src/lib/download-helper.ts index 0dc8d8d6a..08f473ae3 100644 --- a/apps/website/src/lib/download-helper.ts +++ b/apps/website/src/lib/download-helper.ts @@ -4,9 +4,9 @@ export type App = "desktop" | "server"; export type Architecture = 'x64' | 'arm64'; -export type Platform = 'macos' | 'windows' | 'linux'; +export type Platform = "macos" | "windows" | "linux" | "pikapod"; -let version = rootPackageJson.version; +const version = rootPackageJson.version; export interface DownloadInfo { recommended?: boolean; @@ -20,7 +20,7 @@ export interface DownloadMatrixEntry { downloads: Record; } -type DownloadMatrix = Record>; +type DownloadMatrix = Record; // Keep compatibility info inline with https://github.com/electron/electron/blob/main/README.md#platform-support. export const downloadMatrix: DownloadMatrix = { @@ -131,7 +131,7 @@ export function buildDownloadUrl(app: App, platform: Platform, format: string, a if (app === "desktop") { return `https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNextNotes-v${version}-${platform}-${architecture}.${format}`; } else if (app === "server") { - return downloadMatrix.server[platform].downloads[format].url ?? "#"; + return downloadMatrix.server[platform]?.downloads[format].url ?? "#"; } else { return "#"; } @@ -149,7 +149,7 @@ export function getArchitecture(): Architecture { function getPlatform(): Platform { const userAgent = navigator.userAgent.toLowerCase(); if (userAgent.includes('macintosh') || userAgent.includes('mac os x')) { - return "mac"; + return "macos"; } else if (userAgent.includes('windows') || userAgent.includes('win32')) { return "windows"; } else { diff --git a/apps/website/tsconfig.json b/apps/website/tsconfig.json index 0b2d8865f..5adb685c0 100644 --- a/apps/website/tsconfig.json +++ b/apps/website/tsconfig.json @@ -9,7 +9,8 @@ "skipLibCheck": true, "sourceMap": true, "strict": true, - "moduleResolution": "bundler" + "moduleResolution": "bundler", + "composite": true } // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files diff --git a/tsconfig.json b/tsconfig.json index db83e7978..743d3d834 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -59,6 +59,9 @@ }, { "path": "./packages/share-theme" + }, + { + "path": "./apps/website" } ] }