Compare commits

...

11 commits
1.0.3 ... main

18 changed files with 1018 additions and 1161 deletions

View file

@ -12,11 +12,9 @@ jobs:
steps:
- name: Checking Out Repository Code
uses: https://code.forgejo.org/actions/checkout@v3
- name: Get Yarn Cache Directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Set Up Yarn Cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@ -25,65 +23,11 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install
- name: Install Chromium for Unlighthouse
run: |
echo "apt update && apt install -y chromium"
apt update && apt install -y chromium
echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --no-sandbox" >> /etc/chromium.d/default-flags'
echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --no-sandbox"' >> /etc/chromium.d/default-flags
- name: Add Unlighthouse
run: |
echo "yarn global add @unlighthouse/cli"
yarn global add @unlighthouse/cli
- name: Run Linter
run: yarn lint
- name: Check if Version in package.json matches Tag
run: |
VERSION=$(cat package.json | grep "version" | sed 's/.*://' | tr -d , | tr -d \" | tr -d " " )
if test $VERSION != "${{ github.ref_name }}"; then
echo "Expected Version is: '${{ github.ref_name }}' actual Version is: '$VERSION'";
exit 1
else
echo "Version is: '$VERSION'";
fi
- name: Build Site
run: yarn build
- name: Start Server
run: |
export KUMA_USERNAME=${{ secrets.KUMA_USERNAME }}
export KUMA_PASSWORD=${{ secrets.KUMA_PASSWORD }}
yarn preview &
- name: Run Unlighthouse for Desktop
run: unlighthouse-ci --build-static --desktop --outputPath reports/desktop
- name: Refresh Server
run: |
if ! pgrep -f "node /usr/bin/yarn" ; then
export KUMA_USERNAME=${{ secrets.KUMA_USERNAME }}
export KUMA_PASSWORD=${{ secrets.KUMA_PASSWORD }}
yarn preview &
fi
- name: Run Unlighthouse for Mobile
run: unlighthouse-ci --build-static --mobile --outputPath reports/mobile
- name: Uploading Lighthouse Reports
uses: actions/upload-artifact@v3
with:
name: lighthouse
path: reports
if-no-files-found: error
build:
needs: test
if: success()

View file

@ -12,11 +12,9 @@ jobs:
steps:
- name: Checking Out Repository Code
uses: https://code.forgejo.org/actions/checkout@v3
- name: Get Yarn Cache Directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Set Up Yarn Cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@ -25,51 +23,7 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install
- name: Install Chromium for Unlighthouse
run: |
echo "apt update && apt install -y chromium"
apt update && apt install -y chromium
echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --no-sandbox" >> /etc/chromium.d/default-flags'
echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --no-sandbox"' >> /etc/chromium.d/default-flags
- name: Add Unlighthouse
run: |
echo "yarn global add @unlighthouse/cli"
yarn global add @unlighthouse/cli
- name: Run Linter
run: yarn lint
- name: Build Site
run: yarn build
- name: Start Server
run: |
export KUMA_USERNAME=${{ secrets.KUMA_USERNAME }}
export KUMA_PASSWORD=${{ secrets.KUMA_PASSWORD }}
yarn preview &
- name: Run Unlighthouse for Desktop
run: unlighthouse-ci --build-static --desktop --outputPath reports/desktop
- name: Refresh Server
run: |
if ! pgrep -f "node /usr/bin/yarn" ; then
export KUMA_USERNAME=${{ secrets.KUMA_USERNAME }}
export KUMA_PASSWORD=${{ secrets.KUMA_PASSWORD }}
yarn preview &
fi
- name: Run Unlighthouse for Mobile
run: unlighthouse-ci --build-static --mobile --outputPath reports/mobile
- name: Uploading Lighthouse Reports
uses: actions/upload-artifact@v3
with:
name: lighthouse
path: reports
if-no-files-found: error

View file

@ -0,0 +1,75 @@
name: 'Test Docker Image with Unlighthouse'
author: 'Neshura'
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
pull_request:
branches:
- main
jobs:
test:
runs-on: docker
steps:
- name: Checking Out Repository Code
uses: https://code.forgejo.org/actions/checkout@v3
- name: Get Yarn Cache Directory
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Set Up Yarn Cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install
- name: Install Chromium for Unlighthouse
run: |
echo "apt update && apt install -y chromium"
apt update && apt install -y chromium
echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --no-sandbox" >> /etc/chromium.d/default-flags'
echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --no-sandbox"' >> /etc/chromium.d/default-flags
- name: Add Unlighthouse
run: |
echo "yarn global add @unlighthouse/cli"
yarn global add @unlighthouse/cli
- name: Build Site
run: yarn build
- name: Start Server
run: |
export KUMA_USERNAME=${{ secrets.KUMA_USERNAME }}
export KUMA_PASSWORD=${{ secrets.KUMA_PASSWORD }}
yarn preview &
- name: Run Unlighthouse for Desktop
run: unlighthouse-ci --build-static --desktop --outputPath reports/desktop
- name: Refresh Server
run: |
if ! pgrep -f "node /usr/bin/yarn" ; then
export KUMA_USERNAME=${{ secrets.KUMA_USERNAME }}
export KUMA_PASSWORD=${{ secrets.KUMA_PASSWORD }}
yarn preview &
fi
- name: Run Unlighthouse for Mobile
run: unlighthouse-ci --build-static --mobile --outputPath reports/mobile
- name: Uploading Lighthouse Reports
uses: actions/upload-artifact@v3
with:
name: lighthouse
path: reports
if-no-files-found: error

View file

@ -14,8 +14,6 @@ WORKDIR /app
COPY --from=build /app .
ENV NODE_ENV production
ENV KUMA_USERNAME ''
ENV KUMA_PASSWORD ''
EXPOSE 8000
CMD ["yarn", "preview"]

View file

@ -2,7 +2,7 @@
"name": "main-site",
"author": "Neshura",
"license": "AGPL-3.0-or-later",
"version": "1.0.3",
"version": "1.0.9",
"private": true,
"scripts": {
"dev": "vite dev",
@ -16,11 +16,11 @@
"ui": "npx shadcn-svelte@latest"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-auto": "^6.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "8.56.0",
"@types/socket.io": "^3.0.2",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@types/eslint": "9.6.1",
"@types/sanitize-html": "^2.15.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"autoprefixer": "^10.4.16",
@ -32,16 +32,16 @@
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"prettier-plugin-tailwindcss": "^0.5.9",
"svelte": "^5.0.0-next.1",
"svelte": "^5.0.0",
"svelte-check": "^3.6.0",
"tailwindcss": "^3.3.6",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3"
"vite": "^6.2.5"
},
"type": "module",
"dependencies": {
"bits-ui": "^0.13.2",
"bits-ui": "1.3.16",
"clsx": "^2.1.0",
"radix-icons-svelte": "^1.2.1",
"sanitize-html": "^2.11.0",

View file

@ -1,14 +1,14 @@
<svelte:options runes={true} />
<script lang="ts">
import { Clipboard, Copy, OpenInNewWindow } from 'radix-icons-svelte';
import { Copy, OpenInNewWindow } from 'radix-icons-svelte';
import { quintInOut } from 'svelte/easing';
import { slide } from 'svelte/transition';
import { IconType, type Server } from '$lib/types/data-types';
import { Skeleton } from '$lib/components/ui/skeleton';
import { Button } from '$lib/components/ui/button';
let { server, icons, monitor } = $props<{
let { server, icons } = $props<{
server: Server;
icons: Array<string>;
}>();
@ -37,12 +37,6 @@
}
$effect(() => {
if (typeof server.id === 'undefined') {
status = 99;
}
if (typeof monitor !== 'undefined') {
status = monitor.status;
}
if (icons.length != 0 && typeof server.icon !== 'undefined') {
const rootSplit = server.icon.split('/');
const root = rootSplit[rootSplit.length - 1];
@ -66,8 +60,9 @@
<div class="flex flex-row justify-between">
<div
class="flex flex-row items-center gap-1"
on:mouseover={() => (hover.title = true)}
on:mouseleave={() => (hover.title = false)}
onmouseover={() => (hover.title = true)}
onfocus={() => (hover.title = true)}
onmouseleave={() => (hover.title = false)}
>
{#if typeof server.icon !== 'undefined'}
{#if img_source != ''}
@ -119,8 +114,9 @@
<a
class="flex flex-row rounded-md border-x-2 px-2 text-sm hover:border-secondary hover:text-secondary"
href={server.href}
on:mouseover={() => (hover.link = true)}
on:mouseleave={() => (hover.link = false)}
onmouseover={() => (hover.link = true)}
onfocus={() => (hover.title = true)}
onmouseleave={() => (hover.link = false)}
>
Open
{#if hover.link}
@ -140,8 +136,9 @@
<a
class="flex flex-row rounded-md border-x-2 px-2 text-sm hover:border-secondary hover:text-secondary"
href={server.extLink}
on:mouseover={() => (hover.ext = true)}
on:mouseleave={() => (hover.ext = false)}
onmouseover={() => (hover.ext = true)}
onfocus={() => (hover.title = true)}
onmouseleave={() => (hover.ext = false)}
>
Official Site
{#if hover.ext}

View file

@ -10,11 +10,8 @@
let { service, icons, monitor } = $props<{
service: Service;
icons: Array<string>;
monitor: Heartbeat;
}>();
let status = $state(4);
let hover = $state({
title: false,
link: false,
@ -35,9 +32,6 @@
}
$effect(() => {
if (typeof monitor !== 'undefined') {
status = monitor.status;
}
if (icons.length != 0) {
const rootSplit = service.icon.split('/');
const root = rootSplit[rootSplit.length - 1];
@ -61,8 +55,9 @@
<div class="flex flex-row justify-between">
<div
class="flex flex-row items-center gap-1"
on:mouseover={() => (hover.title = true)}
on:mouseleave={() => (hover.title = false)}
onmouseover={() => (hover.title = true)}
onfocus={() => (hover.title = true)}
onmouseleave={() => (hover.title = false)}
>
{#if service.icon}
{#if img_source != ''}
@ -96,8 +91,9 @@
<a
class="flex flex-row rounded-md border-x-2 px-2 text-sm hover:border-secondary hover:text-secondary"
href={service.href}
on:mouseover={() => (hover.link = true)}
on:mouseleave={() => (hover.link = false)}
onmouseover={() => (hover.link = true)}
onfocus={() => (hover.title = true)}
onmouseleave={() => (hover.link = false)}
>
Open
{#if hover.link}
@ -116,8 +112,9 @@
<a
class="flex flex-row rounded-md border-x-2 px-2 text-sm hover:border-secondary hover:text-secondary"
href={service.extLink}
on:mouseover={() => (hover.ext = true)}
on:mouseleave={() => (hover.ext = false)}
onmouseover={() => (hover.ext = true)}
onfocus={() => (hover.title = true)}
onmouseleave={() => (hover.ext = false)}
>
Official Site
{#if hover.ext}

View file

@ -1,7 +1,7 @@
<script lang="ts">
import { Button as ButtonPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
import { buttonVariants, type Props, type Events } from '.';
import { type Events, type Props, buttonVariants } from './index.js';
import { cn } from '$lib/utils.js';
type $$Props = Props;
type $$Events = Events;

View file

@ -1,16 +1,16 @@
import type { Button as ButtonPrimitive } from 'bits-ui';
import { tv, type VariantProps } from 'tailwind-variants';
import { type VariantProps, tv } from 'tailwind-variants';
import Root from './button.svelte';
const buttonVariants = tv({
base: 'inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
base: 'focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50',
variants: {
variant: {
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow',
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
outline:
'border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground',
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
'border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm',
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
ghost: 'hover:bg-accent hover:text-accent-foreground',
link: 'text-primary underline-offset-4 hover:underline'
},

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { Separator as SeparatorPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
import { cn } from '$lib/utils.js';
type $$Props = SeparatorPrimitive.Props;
@ -13,7 +13,7 @@
<SeparatorPrimitive.Root
class={cn(
'shrink-0 bg-border',
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
orientation === 'horizontal' ? 'h-[1px] w-full' : 'min-h-full w-[1px]',
className
)}
{orientation}

View file

@ -1,6 +1,6 @@
<script lang="ts">
import { cn } from '$lib/utils';
import type { HTMLAttributes } from 'svelte/elements';
import { cn } from '$lib/utils.js';
type $$Props = HTMLAttributes<HTMLDivElement>;
@ -8,4 +8,4 @@
export { className as class };
</script>
<div class={cn('animate-pulse rounded-md bg-primary/10', className)} {...$$restProps} />
<div class={cn('animate-pulse rounded-md bg-primary/10', className)} {...$$restProps}></div>

View file

@ -3,23 +3,15 @@
<script>
import '../app.pcss';
import Header from './Header.svelte';
import { beforeNavigate } from '$app/navigation';
import Footer from './Footer.svelte';
$effect(() => {
beforeNavigate((navigation) => {
const servers =
navigation.to.url.pathname === '/servers' || navigation.from.url.pathname === '/servers';
const services =
navigation.to.url.pathname === '/services' || navigation.from.url.pathname === '/services';
});
});
let { children } = $props();
</script>
<Header />
<div class="h-full pb-8 pt-16">
<slot />
{@render children()}
</div>
<Footer />

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { page } from '$app/stores';
import { page } from '$app/state';
import { Button } from '$lib/components/ui/button';
const button = 'border-t-2 bg-black/55 hover:bg-black/70 hover:border-secondary w-28';
@ -12,7 +12,7 @@
<Button
variant="ghost"
href="/"
class="{button} + {!($page.url.pathname === '/') || 'border-secondary text-secondary'}"
class="{button} + {!(page.url.pathname === '/') || 'border-secondary text-secondary'}"
>
Home
</Button>
@ -21,7 +21,7 @@
<Button
variant="ghost"
href="/servers"
class="{button} + {!$page.url.pathname.startsWith('/servers') ||
class="{button} + {!page.url.pathname.startsWith('/servers') ||
'border-secondary text-secondary'}"
>
Servers
@ -31,7 +31,7 @@
<Button
variant="ghost"
href="/services"
class="{button} + {!$page.url.pathname.startsWith('/services') ||
class="{button} + {!page.url.pathname.startsWith('/services') ||
'border-secondary text-secondary'}"
>
Services
@ -41,7 +41,7 @@
<Button
variant="ghost"
href="/about"
class="{button} + {!$page.url.pathname.startsWith('/about') ||
class="{button} + {!page.url.pathname.startsWith('/about') ||
'border-secondary text-secondary'}"
>
About

View file

@ -4,9 +4,9 @@
import type { Server } from '$lib/types/data-types';
import ServerCard from '$lib/components/ServerCard.svelte';
let servers: readonly Server[] = $state.frozen([]);
let servers: readonly Server[] = $state.raw([]);
let icons: readonly string[] = $state.frozen([]);
let icons: readonly string[] = $state.raw([]);
async function get(url: string): Promise<any> {
let res = await fetch(url);

View file

@ -3,12 +3,10 @@
<script lang="ts">
import ServiceCard from '$lib/components/ServiceCard.svelte';
import type { Service } from '$lib/types/data-types';
import { io } from 'socket.io-client';
import { onDestroy } from 'svelte';
let services: readonly Service[] = $state.frozen([]);
let services: readonly Service[] = $state.raw([]);
let icons: readonly string[] = $state.frozen([]);
let icons: readonly string[] = $state.raw([]);
async function get(url: string): Promise<any> {
let res = await fetch(url);

View file

@ -2,7 +2,7 @@ export default {
site: 'http://localhost:8000',
ci: {
budget: {
performance: 90,
performance: 60,
accessibility: 100,
'best-practices': 90,
seo: 90

View file

@ -10,5 +10,6 @@ export default defineConfig({
preview: {
host: true,
port: 8000,
allowedHosts: true,
}
});

1879
yarn.lock

File diff suppressed because it is too large Load diff