build(website): build site from db data

This commit is contained in:
iCrawl
2023-04-01 02:50:24 +02:00
parent 34bc36ac4b
commit 311cab2d3f
63 changed files with 740 additions and 641 deletions

View File

@@ -143,6 +143,15 @@ jobs:
mv docs/${PACKAGE}/docs/docs.api.json out/${PACKAGE}/${SEMVER}.api.json
fi
- name: Upload documentation to database
if: ${{ github.ref_type == 'tag' && matrix.package == steps.extract-tag.outputs.package }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
uses: ./packages/actions/src/uploadDocumentation
with:
package: ${{ steps.extract-tag.outputs.package }}
version: ${{ steps.extract-tag.outputs.semver }}
- name: Move docs to correct directory
if: ${{ github.ref_type == 'branch' }}
env:
@@ -156,6 +165,14 @@ jobs:
mv docs/${PACKAGE}/docs/docs.api.json out/${PACKAGE}/${GITHUB_REF_NAME}.api.json
fi
- name: Upload documentation to database
if: ${{ github.ref_type == 'branch' }}
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
uses: ./packages/actions/src/uploadDocumentation
with:
package: ${{ matrix.package }}
- name: Commit and push
run: |
cd out

View File

@@ -48,7 +48,7 @@
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^0.1.11",
"@vercel/edge-config": "^0.1.5",
"@vercel/og": "^0.4.2",
"@vercel/og": "^0.5.0",
"ariakit": "^2.0.0-next.43",
"cmdk": "^0.2.0",
"contentlayer": "^0.3.1",
@@ -71,16 +71,16 @@
"@next/bundle-analyzer": "^13.2.4",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "18.15.10",
"@types/react": "^18.0.30",
"@types/node": "18.15.11",
"@types/react": "^18.0.31",
"@types/react-dom": "^18.0.11",
"@unocss/cli": "^0.50.6",
"@unocss/reset": "^0.50.6",
"@vitejs/plugin-react": "^3.1.0",
"@vitest/coverage-c8": "^0.29.8",
"concurrently": "^7.6.0",
"concurrently": "^8.0.1",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"happy-dom": "^8.9.0",
@@ -90,10 +90,10 @@
"lighthouse": "^10.1.0",
"prettier": "^2.8.7",
"prettier-plugin-astro": "^0.8.0",
"prettier-plugin-tailwindcss": "^0.2.5",
"typescript": "^5.0.2",
"prettier-plugin-tailwindcss": "^0.2.6",
"typescript": "^5.0.3",
"unocss": "^0.50.6",
"vercel": "^28.18.2",
"vercel": "^28.18.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -4,7 +4,7 @@ export default function Error({ error }: { error: Error }) {
console.error(error);
return (
<div className="mx-auto flex h-full max-w-lg flex-col place-content-center place-items-center gap-8 py-16 px-8 lg:py-0 lg:px-6">
<div className="mx-auto flex h-full max-w-lg flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">500</h1>
<h2 className="text-[2rem] md:text-[3rem]">Error.</h2>
</div>

View File

@@ -11,7 +11,7 @@ export default function GlobalError({ error }: { error: Error }) {
<body className="dark:bg-dark-800 bg-light-600">
<Providers>
<main className="mx-auto h-screen max-w-2xl">
<div className="mx-auto flex h-screen max-w-lg flex-col place-content-center place-items-center gap-8 py-16 px-8 lg:py-0 lg:px-6">
<div className="mx-auto flex h-screen max-w-lg flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">500</h1>
<h2 className="text-[2rem] md:text-[3rem]">Error.</h2>
</div>

View File

@@ -2,7 +2,7 @@ import Link from 'next/link';
export default function NotFound() {
return (
<div className="mx-auto flex min-h-screen max-w-lg flex-col place-content-center place-items-center gap-8 py-16 px-8 lg:py-0 lg:px-6">
<div className="mx-auto flex min-h-screen max-w-lg flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">404</h1>
<h2 className="text-[2rem] md:text-[3rem]">Not found.</h2>
<Link

View File

@@ -3,7 +3,7 @@ import vercelLogo from '~/assets/powered-by-vercel.svg';
export default function Page() {
return (
<div className="mx-auto flex min-h-screen max-w-6xl flex-col place-items-center gap-12 py-16 px-8 lg:place-content-center lg:py-0 lg:px-8">
<div className="mx-auto flex min-h-screen max-w-6xl flex-col place-items-center gap-12 px-8 py-16 lg:place-content-center lg:px-8 lg:py-0">
<div className="flex flex-row place-content-center">
<a
className="focus:ring-width-2 focus:ring-blurple rounded outline-0 focus:ring"

View File

@@ -18,7 +18,7 @@ export function Navbar({ pages }: { pages?: MDXPage[] | undefined }) {
return (
<>
<header className="dark:bg-dark-400 dark:border-dark-100 bg-light-600 border-light-800 fixed top-0 left-0 z-20 w-full border-b">
<header className="dark:bg-dark-400 dark:border-dark-100 bg-light-600 border-light-800 fixed left-0 top-0 z-20 w-full border-b">
<div className="block h-16 px-6">
<div className="flex h-full flex-row place-content-between place-items-center">
<Button
@@ -55,7 +55,7 @@ export function Navbar({ pages }: { pages?: MDXPage[] | undefined }) {
</Button>
<Button
aria-label="Toggle theme"
className="focus:ring-width-2 focus:ring-blurple flex h-6 w-6 transform-gpu cursor-pointer select-none appearance-none place-items-center rounded-full rounded border-0 bg-transparent p-0 text-sm font-semibold leading-none no-underline outline-0 focus:ring active:translate-y-px"
className="focus:ring-width-2 focus:ring-blurple flex h-6 w-6 transform-gpu cursor-pointer select-none appearance-none place-items-center rounded rounded-full border-0 bg-transparent p-0 text-sm font-semibold leading-none no-underline outline-0 focus:ring active:translate-y-px"
// onClick={() => toggleTheme()}
>
<VscColorMode size={24} />

View File

@@ -45,16 +45,16 @@ export function Outline({ headings }: { headings: MarkdownHeading[] }) {
hideTracksWhenNotNeeded
renderThumbVertical={(props) => <div {...props} className="dark:bg-dark-100 bg-light-900 z-30 rounded" />}
renderTrackVertical={(props) => (
<div {...props} className="absolute top-0.5 right-0.5 bottom-0.5 z-30 w-1.5 rounded" />
<div {...props} className="absolute bottom-0.5 right-0.5 top-0.5 z-30 w-1.5 rounded" />
)}
universal
>
<div className="flex flex-col break-all p-3 pb-8">
<div className="mt-4 ml-2 flex flex-row gap-2">
<div className="ml-2 mt-4 flex flex-row gap-2">
<VscListSelection size={25} />
<span className="font-semibold">Contents</span>
</div>
<div className="mt-4 ml-2 flex flex-col gap-2">
<div className="ml-2 mt-4 flex flex-col gap-2">
<div className="relative flex flex-col">
<div
className="bg-blurple absolute h-[10px] w-[10px] rounded-full border-2 border-black dark:border-white"

View File

@@ -1,7 +1,7 @@
export function PageButton({ url, title, direction }: { direction: 'next' | 'prev'; title: string; url: string }) {
return (
<a
className="bg-light-600 hover:bg-light-700 active:bg-light-800 dark:bg-dark-600 dark:hover:bg-dark-500 dark:active:bg-dark-400 focus:ring-width-2 focus:ring-blurple flex transform-gpu cursor-pointer select-none appearance-none flex-row flex-col place-items-center gap-2 rounded py-3 px-4 leading-none no-underline outline-0 focus:ring active:translate-y-px"
className="bg-light-600 hover:bg-light-700 active:bg-light-800 dark:bg-dark-600 dark:hover:bg-dark-500 dark:active:bg-dark-400 focus:ring-width-2 focus:ring-blurple flex transform-gpu cursor-pointer select-none appearance-none flex-row flex-col place-items-center gap-2 rounded px-4 py-3 leading-none no-underline outline-0 focus:ring active:translate-y-px"
href={url}
>
<h3 className="text-md font-semibold">{title}</h3>

View File

@@ -4,7 +4,7 @@ import type { MDXPage } from './SidebarItems.jsx';
export function Sidebar({ pages, opened }: { opened: boolean; pages?: MDXPage[] | undefined }) {
return (
<nav
className={`h-[calc(100vh - 65px)] dark:bg-dark-600 dark:border-dark-100 border-light-800 fixed top-[65px] left-0 bottom-0 z-20 w-full border-r bg-white ${
className={`h-[calc(100vh - 65px)] dark:bg-dark-600 dark:border-dark-100 border-light-800 fixed bottom-0 left-0 top-[65px] z-20 w-full border-r bg-white ${
opened ? 'block' : 'hidden'
} lg:w-76 lg:max-w-76 lg:block`}
>
@@ -13,7 +13,7 @@ export function Sidebar({ pages, opened }: { opened: boolean; pages?: MDXPage[]
hideTracksWhenNotNeeded
renderThumbVertical={(props) => <div {...props} className="dark:bg-dark-100 bg-light-900 z-30 rounded" />}
renderTrackVertical={(props) => (
<div {...props} className="absolute top-0.5 right-0.5 bottom-0.5 z-30 w-1.5 rounded" />
<div {...props} className="absolute bottom-0.5 right-0.5 top-0.5 z-30 w-1.5 rounded" />
)}
universal
>

View File

@@ -50,16 +50,17 @@
"@discordjs/ui": "workspace:^",
"@microsoft/api-extractor-model": "7.26.4",
"@microsoft/tsdoc": "0.14.2",
"@planetscale/database": "^1.6.0",
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^0.1.11",
"@vercel/edge-config": "^0.1.5",
"@vercel/og": "^0.4.2",
"@vercel/og": "^0.5.0",
"@vscode/codicons": "^0.0.32",
"ariakit": "^2.0.0-next.43",
"bright": "^0.7.0",
"cmdk": "^0.2.0",
"meilisearch": "^0.32.0",
"next": "^13.2.5-canary.20",
"next": "^13.2.5-canary.23",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
@@ -77,26 +78,26 @@
"@next/bundle-analyzer": "^13.2.4",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "18.15.10",
"@types/react": "^18.0.30",
"@types/node": "18.15.11",
"@types/react": "^18.0.31",
"@types/react-dom": "^18.0.11",
"@unocss/cli": "^0.50.6",
"@unocss/reset": "^0.50.6",
"@vitejs/plugin-react": "^3.1.0",
"@vitest/coverage-c8": "^0.29.8",
"concurrently": "^7.6.0",
"concurrently": "^8.0.1",
"cpy-cli": "^4.2.0",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"happy-dom": "^8.9.0",
"lighthouse": "^10.1.0",
"prettier": "^2.8.7",
"prettier-plugin-tailwindcss": "^0.2.5",
"typescript": "^5.0.2",
"prettier-plugin-tailwindcss": "^0.2.6",
"typescript": "^5.0.3",
"unocss": "^0.50.6",
"vercel": "^28.18.2",
"vercel": "^28.18.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -1,5 +1,8 @@
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { connect } from '@planetscale/database';
const sql = connect({ url: process.env.DATABASE_URL! });
export async function fetchVersions(packageName: string): Promise<string[]> {
const response = await fetch(`https://docs.discordjs.dev/api/info?package=${packageName}`, {
@@ -24,9 +27,11 @@ export async function fetchModelJSON(packageName: string, version: string): Prom
}
}
const response = await fetch(`https://docs.discordjs.dev/docs/${packageName}/${version}.api.json`, {
next: { revalidate: 3_600 },
});
const { rows } = await sql.execute('select data from documentation where name = ? and version = ?', [
packageName,
version,
]);
return response.json();
// @ts-expect-error: https://github.com/planetscale/database-js/issues/71
return rows[0].data;
}

View File

@@ -4,7 +4,7 @@ export default function Error({ error }: { error: Error }) {
console.error(error);
return (
<div className="mx-auto flex h-full max-w-lg flex-col place-content-center place-items-center gap-8 py-16 px-8 lg:py-0 lg:px-6">
<div className="mx-auto flex h-full max-w-lg flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">500</h1>
<h2 className="text-[2rem] md:text-[3rem]">Error.</h2>
</div>

View File

@@ -27,7 +27,7 @@ export default async function Page({ params }: { params: { package: string } })
const data = await getData(params.package);
return (
<div className="min-w-xs sm:w-md mx-auto flex min-h-screen flex-col gap-8 py-6 px-4 lg:py-6 lg:px-6">
<div className="min-w-xs sm:w-md mx-auto flex min-h-screen flex-col gap-8 px-4 py-6 lg:px-6 lg:py-6">
<h1 className="text-2xl font-semibold">Select a version:</h1>
<div className="flex flex-col gap-4">
{data.map((version, idx) => (

View File

@@ -10,7 +10,7 @@ export const runtime: ServerRuntime = 'edge';
export default function Page() {
return (
<div className="min-w-xs sm:w-md mx-auto flex min-h-screen flex-col gap-8 py-6 px-4 lg:py-6 lg:px-6">
<div className="min-w-xs sm:w-md mx-auto flex min-h-screen flex-col gap-8 px-4 py-6 lg:px-6 lg:py-6">
<h1 className="text-2xl font-semibold">Select a package:</h1>
<div className="flex flex-col gap-4">
<a

View File

@@ -4,7 +4,7 @@ export default function Error({ error }: { error: Error }) {
console.error(error);
return (
<div className="mx-auto flex min-h-screen max-w-lg flex-col place-content-center place-items-center gap-8 py-16 px-8 lg:py-0 lg:px-6">
<div className="mx-auto flex min-h-screen max-w-lg flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">500</h1>
<h2 className="text-[2rem] md:text-[3rem]">Error.</h2>
</div>

View File

@@ -11,7 +11,7 @@ export default function GlobalError({ error }: { error: Error }) {
<body className="dark:bg-dark-800 bg-light-600">
<Providers>
<main className="mx-auto min-h-screen max-w-2xl">
<div className="mx-auto flex min-h-screen max-w-lg flex-col place-content-center place-items-center gap-8 py-16 px-8 lg:py-0 lg:px-6">
<div className="mx-auto flex min-h-screen max-w-lg flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">500</h1>
<h2 className="text-[2rem] md:text-[3rem]">Error.</h2>
</div>

View File

@@ -2,7 +2,7 @@ import Link from 'next/link';
export default function NotFound() {
return (
<div className="mx-auto flex min-h-screen max-w-lg flex-col place-content-center place-items-center gap-8 py-16 px-8 lg:py-0 lg:px-6">
<div className="mx-auto flex min-h-screen max-w-lg flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">404</h1>
<h2 className="text-[2rem] md:text-[3rem]">Not found.</h2>
<Link

View File

@@ -7,11 +7,11 @@ import { CODE_EXAMPLE } from '~/util/constants';
export default function Page() {
return (
<div className="mx-auto flex min-h-screen max-w-6xl flex-col place-items-center gap-12 py-16 px-8 lg:place-content-center lg:py-0 lg:px-8">
<div className="mx-auto flex min-h-screen max-w-6xl flex-col place-items-center gap-12 px-8 py-16 lg:place-content-center lg:px-8 lg:py-0">
<div className="flex flex-col place-items-center gap-10 lg:flex-row lg:gap-6">
<div className="flex max-w-lg flex-col gap-3 lg:mr-8">
<h1 className="text-3xl font-black leading-tight sm:text-5xl sm:leading-tight">
The <span className="bg-blurple relative rounded py-1 px-3 text-white">most popular</span> way to build
The <span className="bg-blurple relative rounded px-3 py-1 text-white">most popular</span> way to build
Discord <br /> bots.
</h1>
<p className="my-6 leading-normal text-neutral-700 dark:text-neutral-300">

View File

@@ -112,7 +112,7 @@ export function CmdKDialog() {
}, [search]);
return (
<Dialog className="fixed top-1/4 left-1/2 z-50 -translate-x-1/2" state={dialog!}>
<Dialog className="fixed left-1/2 top-1/4 z-50 -translate-x-1/2" state={dialog!}>
<Command
className="dark:bg-dark/50 min-w-xs sm:min-w-lg dark:border-dark-100 border-light-900 max-w-xs rounded border bg-white/50 shadow backdrop-blur-md sm:max-w-lg"
label="Command Menu"

View File

@@ -24,7 +24,7 @@ export function Nav({ members }: { members: SidebarSectionItemData[] }) {
hideTracksWhenNotNeeded
renderThumbVertical={(props) => <div {...props} className="dark:bg-dark-100 bg-light-900 z-30 rounded" />}
renderTrackVertical={(props) => (
<div {...props} className="absolute top-0.5 right-0.5 bottom-0.5 z-30 w-1.5 rounded" />
<div {...props} className="absolute bottom-0.5 right-0.5 top-0.5 z-30 w-1.5 rounded" />
)}
universal
>

View File

@@ -6,13 +6,13 @@ import { TableOfContentItems } from './TableOfContentItems';
export function Outline({ members }: { members: TableOfContentsSerialized[] }) {
return (
<aside className="dark:bg-dark-600 dark:border-dark-100 border-light-800 fixed top-[50px] right-0 bottom-0 z-20 hidden h-[calc(100vh_-_65px)] w-64 border-l bg-white pr-2 xl:block">
<aside className="dark:bg-dark-600 dark:border-dark-100 border-light-800 fixed bottom-0 right-0 top-[50px] z-20 hidden h-[calc(100vh_-_65px)] w-64 border-l bg-white pr-2 xl:block">
<Scrollbars
autoHide
hideTracksWhenNotNeeded
renderThumbVertical={(props) => <div {...props} className="dark:bg-dark-100 bg-light-900 z-30 rounded" />}
renderTrackVertical={(props) => (
<div {...props} className="absolute top-0.5 right-0.5 bottom-0.5 z-30 w-1.5 rounded" />
<div {...props} className="absolute bottom-0.5 right-0.5 top-0.5 z-30 w-1.5 rounded" />
)}
universal
>

View File

@@ -87,7 +87,7 @@ export function TableOfContentItems({ serializedMembers }: TableOfContentsItemPr
return (
<div className="flex flex-col break-all p-3 pb-8">
<div className="mt-4 ml-2 flex flex-row gap-2">
<div className="ml-2 mt-4 flex flex-row gap-2">
<VscListSelection size={25} />
<span className="font-semibold">Contents</span>
</div>

View File

@@ -11,7 +11,7 @@ export default function ThemeSwitcher() {
return (
<Button
aria-label="Toggle theme"
className="focus:ring-width-2 focus:ring-blurple flex h-6 w-6 transform-gpu cursor-pointer select-none appearance-none flex-row place-items-center rounded-full rounded border-0 bg-transparent p-0 text-sm font-semibold leading-none no-underline outline-0 focus:ring active:translate-y-px"
className="focus:ring-width-2 focus:ring-blurple flex h-6 w-6 transform-gpu cursor-pointer select-none appearance-none flex-row place-items-center rounded rounded-full border-0 bg-transparent p-0 text-sm font-semibold leading-none no-underline outline-0 focus:ring active:translate-y-px"
onClick={() => toggleTheme()}
>
<VscColorMode size={24} />

View File

@@ -55,10 +55,10 @@
"is-ci": "^3.0.1",
"lint-staged": "^13.2.0",
"tsup": "^6.7.0",
"turbo": "^1.8.6",
"typescript": "^5.0.2",
"turbo": "^1.8.8",
"typescript": "^5.0.3",
"unocss": "^0.50.6",
"vercel": "^28.18.2",
"vercel": "^28.18.3",
"vitest": "^0.29.8"
},
"resolutions": {

View File

@@ -40,18 +40,21 @@
"homepage": "https://discord.js.org",
"dependencies": {
"@actions/core": "^1.10.0",
"tslib": "^2.5.0"
"@actions/glob": "^0.4.0",
"@planetscale/database": "^1.6.0",
"tslib": "^2.5.0",
"undici": "^5.21.0"
},
"devDependencies": {
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -0,0 +1,11 @@
name: 'Upload documentation'
description: 'Uploads the docs.json file to a planetscale database'
inputs:
package:
description: 'The package string'
required: true
semver:
description: 'The semver string'
runs:
using: node16
main: ../../dist/uploadDocumentation/index.mjs

View File

@@ -0,0 +1,29 @@
import { readFile } from 'node:fs/promises';
import process from 'node:process';
import { getInput, setFailed } from '@actions/core';
import { create } from '@actions/glob';
import { connect } from '@planetscale/database';
import { fetch } from 'undici';
if (!process.env.DATABASE_URL) {
process.exit(0);
}
const pkg = getInput('package', { required: true });
const version = getInput('version') || 'main';
const sql = connect({
fetch,
url: process.env.DATABASE_URL,
});
const globber = await create(`packages/${pkg}/docs/docs.api.json`);
for await (const file of globber.globGenerator()) {
const data = await readFile(file, 'utf8');
try {
await sql.execute('replace into documentation (version, data) values (?, ?)', [version, data]);
} catch (error) {
const err = error as Error;
setFailed(err.message);
}
}

View File

@@ -1,7 +1,7 @@
import { createTsupConfig } from '../../tsup.config.js';
export default createTsupConfig({
entry: ['src/index.ts', 'src/formatTag/index.ts'],
entry: ['src/index.ts', 'src/formatTag/index.ts', 'src/uploadDocumentation/index.ts'],
format: ['esm'],
minify: true,
});

View File

@@ -35,14 +35,14 @@
"@microsoft/tsdoc": "0.14.2"
},
"devDependencies": {
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2"
"typescript": "^5.0.3"
},
"engines": {
"node": ">=16.9.0"

View File

@@ -5,4 +5,5 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
coverage/
dist-docs/

View File

@@ -64,15 +64,15 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -5,4 +5,5 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
coverage/
dist-docs/

View File

@@ -66,17 +66,17 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"downlevel-dts": "^0.11.0",
"esbuild-plugin-version-injector": "^1.1.0",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -5,4 +5,5 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
coverage/
dist-docs/

View File

@@ -53,16 +53,16 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.1.0",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -6,3 +6,4 @@ docs/**/*
!docs/index.yml
!docs/README.md
coverage/
dist-docs/

View File

@@ -56,15 +56,15 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -66,15 +66,15 @@
"devDependencies": {
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^2.0.0",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"dtslint": "^4.2.1",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-formatter-pretty": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^2.8.7",
"tsd": "^0.28.1",
"tslint": "^6.1.3",
"typescript": "^5.0.2"
"typescript": "^5.0.3"
},
"engines": {
"node": ">=16.9.0"

View File

@@ -48,14 +48,14 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@types/jsdoc-to-markdown": "^7.0.3",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2"
"typescript": "^5.0.3"
},
"engines": {
"node": ">=16.9.0"

View File

@@ -6,3 +6,4 @@ docs/**/*
!docs/index.yml
!docs/README.md
coverage/
dist-docs/

View File

@@ -50,15 +50,15 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -6,3 +6,4 @@ docs/**/*
!docs/index.yml
!docs/README.md
coverage/
dist-docs/

View File

@@ -64,16 +64,16 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "18.15.10",
"@types/node": "18.15.11",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.1.0",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -48,14 +48,14 @@
"tslib": "^2.5.0"
},
"devDependencies": {
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2"
"typescript": "^5.0.3"
},
"engines": {
"node": ">=16.9.0"

View File

@@ -5,4 +5,5 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
coverage/
dist-docs/

View File

@@ -63,17 +63,17 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@types/supertest": "^2.0.12",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"supertest": "^6.3.3",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -5,4 +5,5 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
coverage/
dist-docs/

View File

@@ -65,16 +65,16 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.1.0",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -68,7 +68,7 @@ export async function makeNetworkRequest(
const timeout = setTimeout(() => controller.abort(), manager.options.timeout).unref();
if (requestData.signal) {
// The type polyfill is required because Node.js's types are incomplete.
const signal = requestData.signal as PolyFillAbortSignal;
const signal = requestData.signal as unknown as PolyFillAbortSignal;
// If the user signal was aborted, abort the controller, else abort the local signal.
// The reason why we don't re-use the user's signal, is because users may use the same signal for multiple
// requests, and we do not want to cause unexpected side-effects.

View File

@@ -55,15 +55,15 @@
},
"devDependencies": {
"@types/fs-extra": "^11.0.1",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -51,18 +51,18 @@
"@favware/cliff-jumper": "^2.0.0",
"@ladle/react": "^2.10.2",
"@react-icons/all-files": "^4.1.0",
"@types/node": "16.18.21",
"@types/react": "^18.0.30",
"@types/node": "16.18.23",
"@types/react": "^18.0.31",
"@types/react-dom": "^18.0.11",
"@unocss/reset": "^0.50.6",
"@vitejs/plugin-react": "^3.1.0",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"unocss": "^0.50.6",
"vite": "^4.2.1",
"vite-plugin-dts": "^2.1.0",

View File

@@ -48,18 +48,18 @@ export function Alert({ title, type, children }: PropsWithChildren<IAlert>) {
const { text, border, icon } = resolveType(type);
return (
<div className="mt-6 mb-4">
<div className="mb-4 mt-6">
<div className="relative flex">
<div className="p-4">{children}</div>
<div className="pointer-events-none absolute flex h-full w-full">
<div className={`rounded-tl-1.5 rounded-bl-1.5 w-4 shrink-0 border-t-2 border-b-2 border-l-2 ${border}`} />
<div className={`rounded-tl-1.5 rounded-bl-1.5 w-4 shrink-0 border-b-2 border-l-2 border-t-2 ${border}`} />
<div className={`relative border-b-2 ${border}`}>
<div className={`-translate-y-50% pointer-events-auto flex place-items-center gap-2 px-2 ${text}`}>
{icon}
<span className={`font-semibold ${text}`}>{title}</span>
</div>
</div>
<div className={`rounded-tr-1.5 rounded-br-1.5 flex-1 border-t-2 border-b-2 border-r-2 ${border}`} />
<div className={`rounded-tr-1.5 rounded-br-1.5 flex-1 border-b-2 border-r-2 border-t-2 ${border}`} />
</div>
</div>
</div>

View File

@@ -8,7 +8,7 @@ export function DiscordMessageBaseReply({
}: PropsWithChildren<{ author?: IDiscordMessageAuthorReply | undefined; authorNode?: ReactNode | undefined }>) {
return (
<div
className="before:rounded-tl-1.5 relative mb-1 flex place-items-center before:absolute before:left-[-36px] before:right-full before:top-[50%] before:bottom-0 before:mr-1 before:block before:border-l-2 before:border-t-2 before:border-[rgb(79_84_92)] before:content-none"
className="before:rounded-tl-1.5 relative mb-1 flex place-items-center before:absolute before:bottom-0 before:left-[-36px] before:right-full before:top-[50%] before:mr-1 before:block before:border-l-2 before:border-t-2 before:border-[rgb(79_84_92)] before:content-none"
id="reply-wrapper"
>
<div className="flex place-items-center [&>span]:opacity-60">

View File

@@ -25,7 +25,7 @@ export function DiscordMessageEmbed({
<div className="py-0.5" id="outer-embed-wrapper">
<div className="border-l-blurple grid max-w-max rounded border-l-4 bg-[rgb(47_49_54)]" id="embed-wrapper">
<div className="max-w-128">
<div className="pt-2 pr-4 pb-4 pl-3">
<div className="pb-4 pl-3 pr-4 pt-2">
{author ? <DiscordMessageEmbedAuthor {...author} /> : authorNode ?? null}
{title ? <DiscordMessageEmbedTitle {...title} /> : titleNode ?? null}
{children ? <div className="mt-2 text-sm">{children}</div> : null}

View File

@@ -6,3 +6,4 @@ docs/**/*
!docs/index.yml
!docs/README.md
coverage/
dist-docs/

View File

@@ -54,16 +54,16 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^2.8.7",
"tsd": "^0.28.1",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"engines": {

View File

@@ -5,4 +5,5 @@ dist/
docs/**/*
!docs/index.yml
!docs/README.md
coverage/
coverage/
dist-docs/

View File

@@ -60,16 +60,16 @@
"ws": "^8.13.0"
},
"devDependencies": {
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.21.0",
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@babel/preset-typescript": "^7.21.4",
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/jest": "^29.5.0",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.1.0",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"jest": "^29.5.0",
@@ -78,7 +78,7 @@
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"tweetnacl": "^1.0.3",
"typescript": "^5.0.2"
"typescript": "^5.0.3"
},
"engines": {
"node": ">=16.9.0"

View File

@@ -6,3 +6,4 @@ docs/**/*
!docs/index.yml
!docs/README.md
coverage/
dist-docs/

View File

@@ -72,17 +72,17 @@
"devDependencies": {
"@favware/cliff-jumper": "^2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"@types/node": "16.18.21",
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.1.0",
"eslint": "^8.36.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
"mock-socket": "^9.2.1",
"prettier": "^2.8.7",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"typescript": "^5.0.3",
"undici": "^5.21.0",
"vitest": "^0.29.8",
"zlib-sync": "^0.1.8"

View File

@@ -16,16 +16,17 @@
"dependsOn": ["^build"],
"inputs": [
"../../tsconfig.json",
"src/**/*.astro",
"src/**/*.tsx",
"src/**/*.ts",
"src/**/*.css",
"src/**/*.mdx",
"astro.config.ts",
"src/assets/**/*.svg",
"next-env.d.ts",
"next.config.js",
"tsconfig.json",
"vite.config.ts"
"types.d.ts"
],
"outputs": ["dist/**"]
"outputs": [".next/**"]
},
"@discordjs/website#build:prod": {
"dependsOn": ["^build"],
@@ -80,7 +81,6 @@
"../../.prettierrc.json",
"../../tsconfig.json",
"../../tsconfig.eslint.json",
"src/**/*.astro",
"src/**/*.tsx",
"src/**/*.ts",
"src/**/*.css",
@@ -89,13 +89,13 @@
"scripts/**.mjs",
".eslintignore",
".eslintrc.json",
"astro.config.ts",
".prettierignore",
".prettierrc.js",
".prettierrc.cjs",
".prettierrc.json",
"tsconfig.json",
"tsconfig.eslint.json",
"next.config.js",
"tsup.config.ts",
"vite.config.ts"
],
@@ -108,7 +108,6 @@
"../../.prettierrc.json",
"../../tsconfig.json",
"../../tsconfig.eslint.json",
"src/**/*.astro",
"src/**/*.tsx",
"src/**/*.ts",
"src/**/*.css",
@@ -117,13 +116,13 @@
"scripts/**.mjs",
".eslintignore",
".eslintrc.json",
"astro.config.ts",
".prettierignore",
".prettierrc.js",
".prettierrc.cjs",
".prettierrc.json",
"tsconfig.json",
"tsconfig.eslint.json",
"next.config.js",
"tsup.config.ts",
"vite.config.ts"
],

1045
yarn.lock

File diff suppressed because it is too large Load Diff