Skip to content

Commit

Permalink
format: add formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed Jul 24, 2024
1 parent 0debf75 commit 5c4a6fd
Show file tree
Hide file tree
Showing 27 changed files with 491 additions and 305 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/sync-type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ on:
- main

jobs:

update:

runs-on: ubuntu-latest
permissions: # Job-level permissions configuration starts here
contents: write # 'write' access to repository contents
permissions: # Job-level permissions configuration starts here
contents: write # 'write' access to repository contents

steps:
- name: Checkout
Expand Down
20 changes: 20 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Deep Directories
**/dist
**/smoke
**/node_modules
**/fixtures
**/vendor
**/.vercel

# Files
pnpm-lock.yaml

# Formatted by Biome
**/*.json
**/*.js
**/*.ts
**/*.tsx
**/*.jsx
**/*.mjs
**/*.cjs
**/*.css
2 changes: 1 addition & 1 deletion app/(home)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import type { ReactNode } from "react";
import { layoutOptions } from "../layout-options";

export default function HomeLayout({ children }: { children: ReactNode }) {
return <Layout {...layoutOptions}>{children}</Layout>;
return <Layout {...layoutOptions}>{children}</Layout>;
}
19 changes: 10 additions & 9 deletions app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import landing from "@/app/_images/landing.gif"
import landing from "@/app/_images/landing.gif";
import Image from "next/image";
export default function HomePage() {
return (
<main className="flex h-full flex-col items-center text-center gap-4 mt-15">
<div className="text-2xl font-semibold">Stardust, the container streaming platform</div>
<div className="text-muted-foreground">Stardust is a container streaming platform that allows you to stream your containers to any device, anywhere.</div>
<Image src={landing} alt="Stardust" className="justify-self-center w-[80rem] h-[50rem] rounded-lg p-4" />

</main>
);
return (
<main className="flex h-full flex-col items-center text-center gap-4 mt-15">
<div className="text-2xl font-semibold">Stardust, the container streaming platform</div>
<div className="text-muted-foreground">
Stardust is a container streaming platform that allows you to stream your containers to any device, anywhere.
</div>
<Image src={landing} alt="Stardust" className="justify-self-center w-[80rem] h-[50rem] rounded-lg p-4" />
</main>
);
}
60 changes: 29 additions & 31 deletions app/api/og/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,33 @@ import type { NextRequest } from "next/server";
export const runtime = "edge";

export async function GET(request: NextRequest) {
const title = request.nextUrl.searchParams.get("title");
const description = request.nextUrl.searchParams.get("description");
const inter = fetch(new URL("./inter.woff", import.meta.url)).then((res) =>
res.arrayBuffer(),
);
return new ImageResponse(
<div
tw="h-full w-full flex items-center justify-center text-[#e4e4e7] flex-col"
style={{
backgroundImage: "linear-gradient(to bottom right, #11111b, #1e1e2e)",
}}
>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
width="192"
height="192"
tw="mb-8"
alt=""
src={
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNjZGQ2ZjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1zcGFya2xlcyI+PHBhdGggZD0ibTEyIDMtMS45MTIgNS44MTNhMiAyIDAgMCAxLTEuMjc1IDEuMjc1TDMgMTJsNS44MTMgMS45MTJhMiAyIDAgMCAxIDEuMjc1IDEuMjc1TDEyIDIxbDEuOTEyLTUuODEzYTIgMiAwIDAgMSAxLjI3NS0xLjI3NUwyMSAxMmwtNS44MTMtMS45MTJhMiAyIDAgMCAxLTEuMjc1LTEuMjc1TDEyIDNaIi8+PHBhdGggZD0iTTUgM3Y0Ii8+PHBhdGggZD0iTTE5IDE3djQiLz48cGF0aCBkPSJNMyA1aDQiLz48cGF0aCBkPSJNMTcgMTloNCIvPjwvc3ZnPg=="
}
/>
<p tw="text-4xl text-[#cba6f7]">{title}</p>
<p tw="text-2xl text-[#cdd6f4]">{description}</p>
</div>,
{
width: 1200,
height: 630,
fonts: [{ name: "Inter", data: await inter, weight: 300 }],
},
);
const title = request.nextUrl.searchParams.get("title");
const description = request.nextUrl.searchParams.get("description");
const inter = fetch(new URL("./inter.woff", import.meta.url)).then((res) => res.arrayBuffer());
return new ImageResponse(
<div
tw="h-full w-full flex items-center justify-center text-[#e4e4e7] flex-col"
style={{
backgroundImage: "linear-gradient(to bottom right, #11111b, #1e1e2e)",
}}
>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
width="192"
height="192"
tw="mb-8"
alt=""
src={
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNjZGQ2ZjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1zcGFya2xlcyI+PHBhdGggZD0ibTEyIDMtMS45MTIgNS44MTNhMiAyIDAgMCAxLTEuMjc1IDEuMjc1TDMgMTJsNS44MTMgMS45MTJhMiAyIDAgMCAxIDEuMjc1IDEuMjc1TDEyIDIxbDEuOTEyLTUuODEzYTIgMiAwIDAgMSAxLjI3NS0xLjI3NUwyMSAxMmwtNS44MTMtMS45MTJhMiAyIDAgMCAxLTEuMjc1LTEuMjc1TDEyIDNaIi8+PHBhdGggZD0iTTUgM3Y0Ii8+PHBhdGggZD0iTTE5IDE3djQiLz48cGF0aCBkPSJNMyA1aDQiLz48cGF0aCBkPSJNMTcgMTloNCIvPjwvc3ZnPg=="
}
/>
<p tw="text-4xl text-[#cba6f7]">{title}</p>
<p tw="text-2xl text-[#cdd6f4]">{description}</p>
</div>,
{
width: 1200,
height: 630,
fonts: [{ name: "Inter", data: await inter, weight: 300 }],
},
);
}
18 changes: 9 additions & 9 deletions app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { getPages } from '@/app/source';
import { createSearchAPI } from 'fumadocs-core/search/server';
import { getPages } from "@/app/source";
import { createSearchAPI } from "fumadocs-core/search/server";

export const { GET } = createSearchAPI('advanced', {
indexes: getPages().map((page) => ({
title: page.data.title,
structuredData: page.data.exports.structuredData,
id: page.url,
url: page.url,
})),
export const { GET } = createSearchAPI("advanced", {
indexes: getPages().map((page) => ({
title: page.data.title,
structuredData: page.data.exports.structuredData,
id: page.url,
url: page.url,
})),
});
130 changes: 65 additions & 65 deletions app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
import { getPage, getPages } from "@/app/source";
import type { Metadata } from "next";
import { DocsPage, DocsBody } from "fumadocs-ui/page";
import { Card, Cards } from "fumadocs-ui/components/card";
import { notFound } from "next/navigation";
import { ImageZoom } from "fumadocs-ui/components/image-zoom";
import { DocsBody, DocsPage } from "fumadocs-ui/page";
import { ExternalLinkIcon } from "lucide-react";
import {ImageZoom} from "fumadocs-ui/components/image-zoom";
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import React from "react";
export default async function Page({
params,
params,
}: {
params: { slug?: string[] };
params: { slug?: string[] };
}) {
const page = getPage(params.slug);
const page = getPage(params.slug);

if (page == null) {
notFound();
}
if (page == null) {
notFound();
}

const MDX = page.data.exports.default;
const path = `content/docs/${page.file.path}`;
const MDX = page.data.exports.default;
const path = `content/docs/${page.file.path}`;

return (
<DocsPage
toc={page.data.exports.toc}
lastUpdate={page.data.exports.lastModified}
tableOfContent={{
footer: (
<a
href={`https://github.com/spaceness/stardust-docs/tree/main/${path}`}
target="_blank"
rel="noreferrer noopener"
className="inline-flex items-center text-xs text-muted-foreground hover:text-foreground"
>
Edit on GitHub <ExternalLinkIcon className="ml-1 size-3" />
</a>
),
}}
>
<DocsBody>
<h1>{page.data.title}</h1>
<MDX
components={{
Card: (props) => <Card {...props} />,
Cards: (props) => <Cards {...props} />,
// @ts-expect-error
img: (props) => <ImageZoom {...props} />,
}}
/>
</DocsBody>
</DocsPage>
);
return (
<DocsPage
toc={page.data.exports.toc}
lastUpdate={page.data.exports.lastModified}
tableOfContent={{
footer: (
<a
href={`https://github.com/spaceness/stardust-docs/tree/main/${path}`}
target="_blank"
rel="noreferrer noopener"
className="inline-flex items-center text-xs text-muted-foreground hover:text-foreground"
>
Edit on GitHub <ExternalLinkIcon className="ml-1 size-3" />
</a>
),
}}
>
<DocsBody>
<h1>{page.data.title}</h1>
<MDX
components={{
Card: (props) => <Card {...props} />,
Cards: (props) => <Cards {...props} />,
// @ts-expect-error
img: (props) => <ImageZoom {...props} />,
}}
/>
</DocsBody>
</DocsPage>
);
}

export async function generateStaticParams() {
return getPages().map((page) => ({
slug: page.slugs,
}));
return getPages().map((page) => ({
slug: page.slugs,
}));
}

export function generateMetadata({ params }: { params: { slug?: string[] } }) {
const page = getPage(params.slug);
const page = getPage(params.slug);

if (page == null) notFound();
const imageParams = new URLSearchParams();
const description = page.data.description ?? "";
imageParams.set("title", page.data.title);
imageParams.set("description", description);
if (page == null) notFound();
const imageParams = new URLSearchParams();
const description = page.data.description ?? "";
imageParams.set("title", page.data.title);
imageParams.set("description", description);

const image = {
alt: "Banner",
url: `/api/og?${imageParams.toString()}`,
width: 1200,
height: 630,
};
return {
title: page.data.title,
description: page.data.description,
openGraph: {
url: `/docs/${page.slugs.join("/")}`,
images: image,
},
} satisfies Metadata;
const image = {
alt: "Banner",
url: `/api/og?${imageParams.toString()}`,
width: 1200,
height: 630,
};
return {
title: page.data.title,
description: page.data.description,
openGraph: {
url: `/docs/${page.slugs.join("/")}`,
images: image,
},
} satisfies Metadata;
}
4 changes: 2 additions & 2 deletions app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DocsLayout } from "fumadocs-ui/layout";
import { layoutOptions } from "../layout-options";
import type { ReactNode } from "react";
import { layoutOptions } from "../layout-options";

export default function RootDocsLayout({ children }: { children: ReactNode }) {
return <DocsLayout {...layoutOptions}>{children}</DocsLayout>;
return <DocsLayout {...layoutOptions}>{children}</DocsLayout>;
}
Loading

0 comments on commit 5c4a6fd

Please sign in to comment.