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",
"files": [],
"include": [],
"include": [],
"references": [
{
"path": "../server"

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
import { getRecommendedDownload } from "../download-helper";
import { getRecommendedDownload } from "../download-helper.js";
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 packageJson from "../../../../package.json" with { type: "json" };

View File

@ -1,10 +1,10 @@
import "./Footer.css";
import Icon from "./Icon";
import Icon from "./Icon.js";
import githubIcon from "../assets/boxicons/bx-github.svg?raw";
import githubDiscussionsIcon from "../assets/boxicons/bx-discussion.svg?raw";
import matrixIcon from "../assets/boxicons/bx-message-dots.svg?raw";
import redditIcon from "../assets/boxicons/bx-reddit.svg?raw";
import { Link } from "./Button";
import { Link } from "./Button.js";
export default function Footer() {
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 (
<Link
className="social-button"

View File

@ -1,12 +1,12 @@
import "./Header.css";
import { useLocation } from 'preact-iso';
import DownloadButton from './DownloadButton';
import { Link } from "./Button";
import Icon from "./Icon";
import DownloadButton from './DownloadButton.js';
import { Link } from "./Button.js";
import Icon from "./Icon.js";
import logoPath from "../assets/icon-color.svg";
import menuIcon from "../assets/boxicons/bx-menu.svg?raw";
import { useState } from "preact/hooks";
import { SocialButtons } from "./Footer";
import { SocialButtons } from "./Footer.js";
interface HeaderLink {
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";
@ -210,8 +210,8 @@ export function getRecommendedDownload() {
const format = recommendedDownload?.[0];
const url = buildDownloadUrl("desktop", platform, format || 'zip', architecture);
const platformTitle = downloadMatrix.desktop[platform].title;
const name = typeof platformTitle === "string" ? platformTitle : platformTitle[architecture];
const platformTitle = downloadMatrix.desktop[platform]?.title;
const name = typeof platformTitle === "string" ? platformTitle : platformTitle?.[architecture];
return {
architecture,

View File

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

View File

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

View File

@ -1,10 +1,10 @@
import { ComponentChildren } from 'preact';
import Card from '../../components/Card';
import Section from '../../components/Section';
import DownloadButton from '../../components/DownloadButton';
import Card from '../../components/Card.js';
import Section from '../../components/Section.js';
import DownloadButton from '../../components/DownloadButton.js';
import "./index.css";
import { useColorScheme, usePageTitle } from '../../hooks';
import Button, { Link } from '../../components/Button';
import { useColorScheme, usePageTitle } from '../../hooks.js';
import Button, { Link } from '../../components/Button.js';
import gitHubIcon from "../../assets/boxicons/bx-github.svg?raw";
import dockerIcon from "../../assets/boxicons/bx-docker.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 boardIcon from "../../assets/boxicons/bx-columns-3.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';
export function Home() {
@ -51,7 +51,7 @@ export function Home() {
function HeroSection() {
const platform = getPlatform();
let screenshotUrl: string;
let screenshotUrl: string | null = null;
const colorScheme = useColorScheme();
switch (platform) {

View File

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

View File

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

View File

@ -1,12 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"noEmit": true,
"allowJs": true,
"checkJs": true,
/* Preact Config */
"jsx": "react-jsx",
"jsxImportSource": "preact",
@ -16,5 +13,6 @@
"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/website"
},
{
"path": "./apps/dump-db"
},