chore(website): fix typecheck issues

This commit is contained in:
Elian Doran 2025-09-27 22:36:26 +03:00
parent a15aab395a
commit 5ac2892e34
No known key found for this signature in database
15 changed files with 45 additions and 41 deletions

View File

@ -1,7 +1,7 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"files": [], "files": [],
"include": [], "include": [],
"references": [ "references": [
{ {
"path": "../server" "path": "../server"

View File

@ -22,3 +22,6 @@ dist-ssr
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
*.d.ts
*.map

View File

@ -1,5 +1,5 @@
import { ComponentChildren } from "preact"; import { ComponentChildren } from "preact";
import Icon from "./Icon"; import Icon from "./Icon.js";
import "./Button.css"; import "./Button.css";
interface LinkProps { interface LinkProps {

View File

@ -1,6 +1,6 @@
import { ComponentChildren, HTMLAttributes } from "preact"; import { ComponentChildren, HTMLAttributes } from "preact";
import { Link } from "./Button"; import { Link } from "./Button.js";
import Icon from "./Icon"; import Icon from "./Icon.js";
interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> { interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
title: ComponentChildren; title: ComponentChildren;

View File

@ -1,6 +1,6 @@
import { getRecommendedDownload } from "../download-helper"; import { getRecommendedDownload } from "../download-helper.js";
import "./DownloadButton.css"; import "./DownloadButton.css";
import Button from "./Button"; import Button from "./Button.js";
import downloadIcon from "../assets/boxicons/bx-arrow-in-down-square-half.svg?raw"; import downloadIcon from "../assets/boxicons/bx-arrow-in-down-square-half.svg?raw";
import packageJson from "../../../../package.json" with { type: "json" }; import packageJson from "../../../../package.json" with { type: "json" };

View File

@ -1,10 +1,10 @@
import "./Footer.css"; import "./Footer.css";
import Icon from "./Icon"; import Icon from "./Icon.js";
import githubIcon from "../assets/boxicons/bx-github.svg?raw"; import githubIcon from "../assets/boxicons/bx-github.svg?raw";
import githubDiscussionsIcon from "../assets/boxicons/bx-discussion.svg?raw"; import githubDiscussionsIcon from "../assets/boxicons/bx-discussion.svg?raw";
import matrixIcon from "../assets/boxicons/bx-message-dots.svg?raw"; import matrixIcon from "../assets/boxicons/bx-message-dots.svg?raw";
import redditIcon from "../assets/boxicons/bx-reddit.svg?raw"; import redditIcon from "../assets/boxicons/bx-reddit.svg?raw";
import { Link } from "./Button"; import { Link } from "./Button.js";
export default function Footer() { export default function Footer() {
return ( return (
@ -55,7 +55,7 @@ export function SocialButtons({ className, withText }: { className?: string, wit
) )
} }
function SocialButton({ name, iconSvg, url, withText }: { name: string, iconSvg: string, url: string, withText: boolean }) { function SocialButton({ name, iconSvg, url, withText }: { name: string, iconSvg: string, url: string, withText?: boolean }) {
return ( return (
<Link <Link
className="social-button" className="social-button"

View File

@ -1,12 +1,12 @@
import "./Header.css"; import "./Header.css";
import { useLocation } from 'preact-iso'; import { useLocation } from 'preact-iso';
import DownloadButton from './DownloadButton'; import DownloadButton from './DownloadButton.js';
import { Link } from "./Button"; import { Link } from "./Button.js";
import Icon from "./Icon"; import Icon from "./Icon.js";
import logoPath from "../assets/icon-color.svg"; import logoPath from "../assets/icon-color.svg";
import menuIcon from "../assets/boxicons/bx-menu.svg?raw"; import menuIcon from "../assets/boxicons/bx-menu.svg?raw";
import { useState } from "preact/hooks"; import { useState } from "preact/hooks";
import { SocialButtons } from "./Footer"; import { SocialButtons } from "./Footer.js";
interface HeaderLink { interface HeaderLink {
url: string; url: string;

View File

@ -1,4 +1,4 @@
import rootPackageJson from '../../../package.json'; import rootPackageJson from '../../../package.json' with { type: "json" };
export type App = "desktop" | "server"; export type App = "desktop" | "server";
@ -210,8 +210,8 @@ export function getRecommendedDownload() {
const format = recommendedDownload?.[0]; const format = recommendedDownload?.[0];
const url = buildDownloadUrl("desktop", platform, format || 'zip', architecture); const url = buildDownloadUrl("desktop", platform, format || 'zip', architecture);
const platformTitle = downloadMatrix.desktop[platform].title; const platformTitle = downloadMatrix.desktop[platform]?.title;
const name = typeof platformTitle === "string" ? platformTitle : platformTitle[architecture]; const name = typeof platformTitle === "string" ? platformTitle : platformTitle?.[architecture];
return { return {
architecture, architecture,

View File

@ -26,7 +26,7 @@ export function App() {
} }
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
hydrate(<App />, document.getElementById('app')); hydrate(<App />, document.getElementById('app')!);
} }
export async function prerender(data) { export async function prerender(data) {

View File

@ -1,10 +1,10 @@
import { useState } from "preact/hooks"; import { useState } from "preact/hooks";
import Card from "../../components/Card"; import Card from "../../components/Card.js";
import Section from "../../components/Section"; import Section from "../../components/Section.js";
import { App, Architecture, buildDownloadUrl, downloadMatrix, DownloadMatrixEntry, getArchitecture, Platform } from "../../download-helper"; import { App, Architecture, buildDownloadUrl, downloadMatrix, DownloadMatrixEntry, getArchitecture, Platform } from "../../download-helper.js";
import { usePageTitle } from "../../hooks"; import { usePageTitle } from "../../hooks.js";
import Button, { Link } from "../../components/Button"; import Button, { Link } from "../../components/Button.js";
import Icon from "../../components/Icon"; import Icon from "../../components/Icon.js";
import helpIcon from "../../assets/boxicons/bx-help-circle.svg?raw"; import helpIcon from "../../assets/boxicons/bx-help-circle.svg?raw";
import "./get-started.css"; import "./get-started.css";
import packageJson from "../../../../../package.json" with { type: "json" }; import packageJson from "../../../../../package.json" with { type: "json" };

View File

@ -1,10 +1,10 @@
import { ComponentChildren } from 'preact'; import { ComponentChildren } from 'preact';
import Card from '../../components/Card'; import Card from '../../components/Card.js';
import Section from '../../components/Section'; import Section from '../../components/Section.js';
import DownloadButton from '../../components/DownloadButton'; import DownloadButton from '../../components/DownloadButton.js';
import "./index.css"; import "./index.css";
import { useColorScheme, usePageTitle } from '../../hooks'; import { useColorScheme, usePageTitle } from '../../hooks.js';
import Button, { Link } from '../../components/Button'; import Button, { Link } from '../../components/Button.js';
import gitHubIcon from "../../assets/boxicons/bx-github.svg?raw"; import gitHubIcon from "../../assets/boxicons/bx-github.svg?raw";
import dockerIcon from "../../assets/boxicons/bx-docker.svg?raw"; import dockerIcon from "../../assets/boxicons/bx-docker.svg?raw";
import noteStructureIcon from "../../assets/boxicons/bx-folder.svg?raw"; import noteStructureIcon from "../../assets/boxicons/bx-folder.svg?raw";
@ -29,7 +29,7 @@ import calendarIcon from "../../assets/boxicons/bx-calendar.svg?raw";
import tableIcon from "../../assets/boxicons/bx-table.svg?raw"; import tableIcon from "../../assets/boxicons/bx-table.svg?raw";
import boardIcon from "../../assets/boxicons/bx-columns-3.svg?raw"; import boardIcon from "../../assets/boxicons/bx-columns-3.svg?raw";
import geomapIcon from "../../assets/boxicons/bx-map.svg?raw"; import geomapIcon from "../../assets/boxicons/bx-map.svg?raw";
import { getPlatform } from '../../download-helper'; import { getPlatform } from '../../download-helper.js';
import { useState } from 'preact/hooks'; import { useState } from 'preact/hooks';
export function Home() { export function Home() {
@ -51,7 +51,7 @@ export function Home() {
function HeroSection() { function HeroSection() {
const platform = getPlatform(); const platform = getPlatform();
let screenshotUrl: string; let screenshotUrl: string | null = null;
const colorScheme = useColorScheme(); const colorScheme = useColorScheme();
switch (platform) { switch (platform) {

View File

@ -1,11 +1,11 @@
import Section from "../../components/Section"; import Section from "../../components/Section.js";
import "./SupportUs.css"; import "./SupportUs.css";
import githubIcon from "../../assets/boxicons/bx-github.svg?raw"; import githubIcon from "../../assets/boxicons/bx-github.svg?raw";
import paypalIcon from "../../assets/boxicons/bx-paypal.svg?raw"; import paypalIcon from "../../assets/boxicons/bx-paypal.svg?raw";
import buyMeACoffeeIcon from "../../assets/boxicons/bx-buy-me-a-coffee.svg?raw"; import buyMeACoffeeIcon from "../../assets/boxicons/bx-buy-me-a-coffee.svg?raw";
import Button, { Link } from "../../components/Button"; import Button, { Link } from "../../components/Button.js";
import Card from "../../components/Card"; import Card from "../../components/Card.js";
import { usePageTitle } from "../../hooks"; import { usePageTitle } from "../../hooks.js";
export default function Donate() { export default function Donate() {
usePageTitle("Support us"); usePageTitle("Support us");

View File

@ -1,5 +1,5 @@
import Section from "../components/Section"; import Section from "../components/Section.js";
import { usePageTitle } from "../hooks"; import { usePageTitle } from "../hooks.js";
import "./_404.css"; import "./_404.css";
export function NotFound() { export function NotFound() {

View File

@ -1,12 +1,9 @@
{ {
"extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"target": "ES2020", "target": "ES2020",
"module": "ESNext", "module": "ESNext",
"moduleResolution": "bundler", "moduleResolution": "bundler",
"noEmit": true,
"allowJs": true,
"checkJs": true,
/* Preact Config */ /* Preact Config */
"jsx": "react-jsx", "jsx": "react-jsx",
"jsxImportSource": "preact", "jsxImportSource": "preact",
@ -16,5 +13,6 @@
"react-dom": ["./node_modules/preact/compat/"] "react-dom": ["./node_modules/preact/compat/"]
} }
}, },
"include": ["node_modules/vite/client.d.ts", "**/*"] "include": ["node_modules/vite/client.d.ts", "**/*"],
"exclude": ["dist"]
} }

View File

@ -21,6 +21,9 @@
{ {
"path": "./apps/desktop" "path": "./apps/desktop"
}, },
{
"path": "./apps/website"
},
{ {
"path": "./apps/dump-db" "path": "./apps/dump-db"
}, },