From 8e85be96a154b371b4cf1fb1924155d96150f949 Mon Sep 17 00:00:00 2001 From: Pauline Date: Wed, 20 Dec 2023 01:58:22 -0500 Subject: chore(lint): bump deps and fix linting/format --- apps/website/package.json | 7 +- apps/website/src/components/base/Button.astro | 10 +-- apps/website/src/components/base/Card.astro | 12 +-- apps/website/src/components/base/CodeBlock.astro | 21 ----- .../src/components/base/FormattedDate.astro | 20 ++--- apps/website/src/components/base/Header.astro | 8 +- apps/website/src/components/base/Navbar.astro | 6 +- .../src/components/base/NavbarElement.astro | 90 +++++++++++----------- apps/website/src/components/base/Paragraph.astro | 2 +- .../base/ScrollbarOverlayContainer.astro | 2 +- apps/website/src/components/base/Section.astro | 4 +- apps/website/src/components/base/Slider.astro | 13 ++-- apps/website/src/components/icons/Icon.astro | 4 +- apps/website/src/components/logos/Logo.astro | 7 +- apps/website/src/layouts/BlogPost.astro | 17 ++-- apps/website/src/layouts/Layout.astro | 24 +++--- apps/website/src/pages/blog/[...slug].astro | 4 +- apps/website/src/pages/blog/index.astro | 12 +-- apps/website/src/pages/index.astro | 2 +- apps/website/src/pages/projects/oneconfig.astro | 44 ++++++----- apps/website/vitest.config.ts | 1 - 21 files changed, 143 insertions(+), 167 deletions(-) delete mode 100644 apps/website/src/components/base/CodeBlock.astro (limited to 'apps/website') diff --git a/apps/website/package.json b/apps/website/package.json index e3fb319..bb13cbe 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -7,6 +7,7 @@ "start": "astro start", "build": "astro build", "preview": "astro preview", + "astro": "astro", "test": "vitest" }, "dependencies": { @@ -16,13 +17,13 @@ "@astrojs/tailwind": "^5.0.2", "astro": "^4.0.6", "sass": "^1.69.5", - "tailwindcss": "^3.3.5", + "tailwindcss": "^3.4.0", "vitest": "^0.34.6" }, "devDependencies": { "@polyfrost/config": "workspace:*", - "@types/node": "~20.10.0", + "@types/node": "~20.10.5", "node-html-parser": "^6.1.11", - "typescript": "^5.3.2" + "typescript": "^5.3.3" } } diff --git a/apps/website/src/components/base/Button.astro b/apps/website/src/components/base/Button.astro index 438bafd..285052a 100644 --- a/apps/website/src/components/base/Button.astro +++ b/apps/website/src/components/base/Button.astro @@ -51,8 +51,8 @@ const className = [ const Element = rest.href ? 'a' : 'button' as any; --- - - {iconLeft && } - {text || } - {iconRight && } - + + {iconLeft && } + {text || } + {iconRight && } + diff --git a/apps/website/src/components/base/Card.astro b/apps/website/src/components/base/Card.astro index b3fbc00..7cc51b2 100644 --- a/apps/website/src/components/base/Card.astro +++ b/apps/website/src/components/base/Card.astro @@ -4,8 +4,8 @@ import Icon from '@components/icons/Icon.astro'; import type { HTMLAttributes } from 'astro/types'; interface Props extends HTMLAttributes<'div'> { - icon: Icons; - text?: string; + icon: Icons + text?: string } const { @@ -16,7 +16,7 @@ const { --- -
- -

{text}

-
+
+ +

{text}

+
diff --git a/apps/website/src/components/base/CodeBlock.astro b/apps/website/src/components/base/CodeBlock.astro deleted file mode 100644 index fd2cdd6..0000000 --- a/apps/website/src/components/base/CodeBlock.astro +++ /dev/null @@ -1,21 +0,0 @@ ---- - ---- - -
-	
-	public class MyConfig {
-	
-	    @Switch(name = "Sub Switch", type = OptionType.SWITCH)
-	    public static boolean subSwitch = false;
-	
-	    public MyConfig() {
-	        super(new Mod("My Mod", ModType.UTIL_QOL), "config.json");
-	
-	        addDependency("subSwitch", () -> {
-	            // Do stuff here!
-	        });
-	    }
-	
-	}
-
diff --git a/apps/website/src/components/base/FormattedDate.astro b/apps/website/src/components/base/FormattedDate.astro index 1bcce73..af538b9 100644 --- a/apps/website/src/components/base/FormattedDate.astro +++ b/apps/website/src/components/base/FormattedDate.astro @@ -1,17 +1,17 @@ --- interface Props { - date: Date; + date: Date } const { date } = Astro.props; --- - + diff --git a/apps/website/src/components/base/Header.astro b/apps/website/src/components/base/Header.astro index 70dc799..1ab879e 100644 --- a/apps/website/src/components/base/Header.astro +++ b/apps/website/src/components/base/Header.astro @@ -25,13 +25,13 @@ const { } = Astro.props; const Element = sizes[size] as any; // Unfortunately gotta do this -const className = (align == 'inherit' ? '' : `text-${align} `) - + (size == 'xxl' ? ' page-header' : '') +const className = (align === 'inherit' ? '' : `text-${align} `) + + (size === 'xxl' ? ' page-header' : '') + (attr.class ? ` ${attr.class}` : ''); --- - + + diff --git a/apps/website/src/components/base/Navbar.astro b/apps/website/src/components/base/Navbar.astro index 8fa98df..15f7638 100644 --- a/apps/website/src/components/base/Navbar.astro +++ b/apps/website/src/components/base/Navbar.astro @@ -1,6 +1,6 @@ --- -import config from 'config'; import type { Config } from '@webtypes/Config'; +import config from 'config'; import NavbarElement from './NavbarElement.astro'; --- @@ -9,12 +9,12 @@ import NavbarElement from './NavbarElement.astro'; diff --git a/apps/website/src/components/base/NavbarElement.astro b/apps/website/src/components/base/NavbarElement.astro index 17c3662..6d549bf 100644 --- a/apps/website/src/components/base/NavbarElement.astro +++ b/apps/website/src/components/base/NavbarElement.astro @@ -1,11 +1,11 @@ --- -import type { LogoType, NavbarElement } from '@webtypes/Config'; -import Logo from '@components/logos/Logo.astro'; import Icon from '@components/icons/Icon.astro'; -import ScreenOverlay from './ScreenOverlay.astro'; +import Logo from '@components/logos/Logo.astro'; +import type { LogoType, NavbarElement } from '@webtypes/Config'; import Header from './Header.astro'; -import Tag from './Tag.astro'; +import ScreenOverlay from './ScreenOverlay.astro'; import ScrollbarOverlayContainer from './ScrollbarOverlayContainer.astro'; +import Tag from './Tag.astro'; interface Props { element: NavbarElement @@ -25,66 +25,64 @@ const { ? ( {element.text && element.text} - {element.logo && } - {element.dropdown && } + {element.logo && } + {element.dropdown && } - ) + ) : (

{element.text && element.text} - {element.logo && } - {element.dropdown && } + {element.logo && } + {element.dropdown && }

- )} + )} {element.dropdown && ( - - + +
+ group-focus-within:pointer-events-auto group-focus-within:opacity-100 + focus-within:pointer-events-auto focus-within:opacity-100 + hover:pointer-events-auto hover:opacity-100 + `}> + bg-gray-50 + rounded-t-lg md:rounded-lg + transition-transform + max-sm:translate-y-1/3 max-sm:left-0 + group-focus-within:translate-y-0 + max-h-full md:max-h-96 overflow-y-auto + md:shadow-lg + `}>
+ + ))} diff --git a/apps/website/src/components/base/Paragraph.astro b/apps/website/src/components/base/Paragraph.astro index 832b296..ffb1030 100644 --- a/apps/website/src/components/base/Paragraph.astro +++ b/apps/website/src/components/base/Paragraph.astro @@ -27,5 +27,5 @@ const className = [ ---

- {text || } + {text || }

diff --git a/apps/website/src/components/base/ScrollbarOverlayContainer.astro b/apps/website/src/components/base/ScrollbarOverlayContainer.astro index 84bedf5..235dbc7 100644 --- a/apps/website/src/components/base/ScrollbarOverlayContainer.astro +++ b/apps/website/src/components/base/ScrollbarOverlayContainer.astro @@ -48,4 +48,4 @@ const { ...attr } = Astro.props; background-color: #00000040; } } - + diff --git a/apps/website/src/components/base/Section.astro b/apps/website/src/components/base/Section.astro index 4edf1ba..55e3737 100644 --- a/apps/website/src/components/base/Section.astro +++ b/apps/website/src/components/base/Section.astro @@ -19,8 +19,8 @@ const { const twoColumn = Astro.slots.has('left') || Astro.slots.has('right'); const className = `max-w-[${maxWidth}] ${wFull ? 'w-full' : `w-[${maxWidth}]`} px-5 md:p-0 flex gap-4${ - twoColumn ? ` ${maxWidth == 'none' ? 'justify-center' : 'justify-between md:justify-evenly lg:justify-between'} ${colReverse ? 'flex-col-reverse' : 'flex-col'} md:flex-row md:items-center md:flex-row` : '' - }${props.class ? ` ${props.class}` : ''}`; + twoColumn ? ` ${maxWidth === 'none' ? 'justify-center' : 'justify-between md:justify-evenly lg:justify-between'} ${colReverse ? 'flex-col-reverse' : 'flex-col'} md:flex-row md:items-center md:flex-row` : '' +}${props.class ? ` ${props.class}` : ''}`; ---
diff --git a/apps/website/src/components/base/Slider.astro b/apps/website/src/components/base/Slider.astro index c1b32d1..95ffd05 100644 --- a/apps/website/src/components/base/Slider.astro +++ b/apps/website/src/components/base/Slider.astro @@ -2,20 +2,21 @@ import type { HTMLAttributes } from 'astro/types'; interface Props extends HTMLAttributes<'div'> { - dir?: string; - wrapperClass?: string; + dir?: string + wrapperClass?: string } const { - dir = "left", - wrapperClass = "" + dir = 'left', + wrapperClass = '', } = Astro.props; ---
+ ${dir === 'right' ? 'reverse' : ''} + ${wrapperClass}` +}>
diff --git a/apps/website/src/components/icons/Icon.astro b/apps/website/src/components/icons/Icon.astro index b36d412..693948d 100644 --- a/apps/website/src/components/icons/Icon.astro +++ b/apps/website/src/components/icons/Icon.astro @@ -1,11 +1,11 @@ --- -import { parse } from 'node-html-parser'; import type { HTMLAttributes } from 'astro/types'; +import { parse } from 'node-html-parser'; export type Icons = 'chevron-down' | 'download' | 'book-open'; interface Props extends HTMLAttributes<'svg'> { - icon: Icons + icon: Icons size?: number | [number, number] } diff --git a/apps/website/src/components/logos/Logo.astro b/apps/website/src/components/logos/Logo.astro index ad41aad..52bfe34 100644 --- a/apps/website/src/components/logos/Logo.astro +++ b/apps/website/src/components/logos/Logo.astro @@ -10,19 +10,18 @@ export interface Props extends HTMLAttributes<'svg'> { const { logo, - silent = false, size = undefined, ...attr } = Astro.props; let svg: string | undefined; try { - if (logo == undefined) + if (logo === undefined) return; const dir = '../../../public/media'; svg = (await import(`${dir}/${logo.replaceAll('.', '/')}.svg?raw` /* @vite-ignore */)).default; - if (svg == undefined) + if (svg === undefined) return; if (typeof size == 'number' || Array.isArray(size)) { @@ -52,4 +51,4 @@ catch (err) { --- - + diff --git a/apps/website/src/layouts/BlogPost.astro b/apps/website/src/layouts/BlogPost.astro index ed2a3c3..188aae1 100644 --- a/apps/website/src/layouts/BlogPost.astro +++ b/apps/website/src/layouts/BlogPost.astro @@ -1,10 +1,9 @@ --- +import FormattedDate from '@components/base/FormattedDate.astro'; +import '@styles/blog.css'; import type { CollectionEntry } from 'astro:content'; import Layout from './Layout.astro'; -import '@styles/blog.css'; -import FormattedDate from '@components/base/FormattedDate.astro'; - type Props = CollectionEntry<'blog'>['data']; const { title, description, pubDate, updatedDate, heroImage } = Astro.props; @@ -12,25 +11,25 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
-
- {heroImage && Hero Image} +
+ {heroImage && Hero Image}
- + { updatedDate && (
- Last updated on + Last updated on
) }

{title}

-
+
- +
diff --git a/apps/website/src/layouts/Layout.astro b/apps/website/src/layouts/Layout.astro index 4acc407..1af3a1e 100644 --- a/apps/website/src/layouts/Layout.astro +++ b/apps/website/src/layouts/Layout.astro @@ -20,25 +20,25 @@ const { - - - - - + + + + + - - - - + + + + {title} - +
- +
-
+
diff --git a/apps/website/src/pages/blog/[...slug].astro b/apps/website/src/pages/blog/[...slug].astro index d9995e7..abdde0a 100644 --- a/apps/website/src/pages/blog/[...slug].astro +++ b/apps/website/src/pages/blog/[...slug].astro @@ -19,7 +19,5 @@ const { Content } = await post.render(); --- - + - - diff --git a/apps/website/src/pages/blog/index.astro b/apps/website/src/pages/blog/index.astro index c8f8203..4bccad4 100644 --- a/apps/website/src/pages/blog/index.astro +++ b/apps/website/src/pages/blog/index.astro @@ -1,25 +1,25 @@ --- /// -import Layout from '../../layouts/Layout.astro'; -import FormattedDate from '../../components/base/FormattedDate.astro' import { getCollection } from 'astro:content'; +import FormattedDate from '../../components/base/FormattedDate.astro'; +import Layout from '../../layouts/Layout.astro'; const posts = (await getCollection('blog')).sort( - (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf() + (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf(), ); --- - +
    { posts.map(post => (
  • - +

    {post.data.title}

    - +

  • diff --git a/apps/website/src/pages/index.astro b/apps/website/src/pages/index.astro index 6f88bf5..ccc6852 100644 --- a/apps/website/src/pages/index.astro +++ b/apps/website/src/pages/index.astro @@ -1,6 +1,6 @@ --- -import Layout from "@layouts/Layout.astro"; import Section from '@components/base/Section.astro'; +import Layout from '@layouts/Layout.astro'; ---
    diff --git a/apps/website/src/pages/projects/oneconfig.astro b/apps/website/src/pages/projects/oneconfig.astro index 7badc11..e9728a1 100644 --- a/apps/website/src/pages/projects/oneconfig.astro +++ b/apps/website/src/pages/projects/oneconfig.astro @@ -1,27 +1,27 @@ --- +import Button from '@components/base/Button.astro'; +import Card from '@components/base/Card.astro'; import Header from '@components/base/Header.astro'; -import Logo from '@components/logos/Logo.astro'; +import Paragraph from '@components/base/Paragraph.astro'; import Section from '@components/base/Section.astro'; -import Button from '@components/base/Button.astro'; +import Slider from '@components/base/Slider.astro'; +import Logo from '@components/logos/Logo.astro'; -import Paragraph from '@components/base/Paragraph.astro'; import Layout from '@layouts/Layout.astro'; import { Code } from 'astro:components'; -import Slider from '@components/base/Slider.astro'; -import Card from '@components/base/Card.astro'; ---
    - +
    Meet OneConfig, the library designed for everyone.
    -
    @@ -33,13 +33,13 @@ import Card from '@components/base/Card.astro';
    - stuff + stuff
    - stuff + stuff
    @@ -55,13 +55,14 @@ import Card from '@components/base/Card.astro';
    - stuff + stuff
    -
    - + +}`} + lang="java"/>
    @@ -83,7 +85,7 @@ import Card from '@components/base/Card.astro'; With our simple APIs and documentation, it's easier than ever to integrate your mods with OneConfig.
    -
    @@ -95,17 +97,17 @@ import Card from '@components/base/Card.astro'; We take pride in having the cleanest and most intuitive UI of any mod, config library, or client out there.
    -
    - +
- +
A unified HUD editor
Thanks to OneConfig's HUD API, you can customize any OneConfig-powered HUD to your liking, without having to worry about the hassle of finding the right command or keybind. @@ -119,7 +121,7 @@ import Card from '@components/base/Card.astro'; Discover a wide range of mods integrated with OneConfig to enhance your experience.
-
@@ -148,10 +150,10 @@ import Card from '@components/base/Card.astro';
- +
-
diff --git a/apps/website/vitest.config.ts b/apps/website/vitest.config.ts index 85a3538..57b13a0 100644 --- a/apps/website/vitest.config.ts +++ b/apps/website/vitest.config.ts @@ -2,7 +2,6 @@ import { getViteConfig } from 'astro/config'; export default getViteConfig({ - // @ts-expect-error astro moment test: { globals: true, reporters: ['dot'], -- cgit