chore: deps

This commit is contained in:
iCrawl
2023-08-22 00:30:08 +02:00
parent 899bc5f78b
commit 5d7c59c301
51 changed files with 1805 additions and 2054 deletions

View File

@@ -0,0 +1 @@
METADATA_BASE_URL=http://localhost:3000

View File

@@ -13,12 +13,13 @@ module.exports = withBundleAnalyzer(
withContentlayer({
reactStrictMode: true,
experimental: {
appDir: true,
typedRoutes: true,
},
images: {
dangerouslyAllowSVG: true,
contentDispositionType: 'attachment',
contentSecurityPolicy: "default-src 'self'; frame-src 'none'; sandbox;",
},
poweredByHeader: false,
}),
);

View File

@@ -52,9 +52,9 @@
"@vercel/og": "^0.5.11",
"ariakit": "^2.0.0-next.44",
"cmdk": "^0.2.0",
"contentlayer": "0.3.1",
"next": "^13.4.17",
"next-contentlayer": "0.3.1",
"contentlayer": "^0.3.4",
"next": "^13.4.19",
"next-contentlayer": "^0.3.4",
"next-themes": "^0.2.1",
"react": "^18.2.0",
"react-custom-scrollbars-2": "^4.5.0",
@@ -65,16 +65,16 @@
"sharp": "^0.32.5"
},
"devDependencies": {
"@next/bundle-analyzer": "^13.4.17",
"@next/bundle-analyzer": "^13.4.19",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/html-escaper": "^3.0.0",
"@types/node": "18.17.5",
"@types/node": "18.17.6",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@unocss/cli": "^0.55.1",
"@unocss/eslint-config": "^0.55.1",
"@unocss/reset": "^0.55.1",
"@unocss/cli": "^0.55.2",
"@unocss/eslint-config": "^0.55.2",
"@unocss/reset": "^0.55.2",
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-v8": "^0.34.2",
"concurrently": "^8.2.0",
@@ -82,16 +82,16 @@
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-formatter-pretty": "^5.0.0",
"happy-dom": "^10.10.2",
"happy-dom": "^10.10.4",
"hast-util-to-string": "^2.0.0",
"hastscript": "^7.2.0",
"hastscript": "^8.0.0",
"html-escaper": "^3.0.3",
"lighthouse": "^10.4.0",
"prettier": "^2.8.8",
"lighthouse": "^11.0.0",
"prettier": "^3.0.2",
"turbo": "^1.10.12",
"typescript": "^5.1.6",
"unocss": "^0.55.1",
"vercel": "^31.4.0",
"unocss": "^0.55.2",
"vercel": "^32.0.0",
"vitest": "^0.34.2"
},
"engines": {

View File

@@ -13,6 +13,9 @@ import '~/styles/ch.css';
import '~/styles/main.css';
export const metadata: Metadata = {
metadataBase: new URL(
process.env.METADATA_BASE_URL ? process.env.METADATA_BASE_URL : `http://localhost:${process.env.PORT ?? 3_000}`,
),
title: 'discord.js',
description: DESCRIPTION,
viewport: {

View File

@@ -3,6 +3,7 @@
import { VscGithubInverted } from '@react-icons/all-files/vsc/VscGithubInverted';
import { VscMenu } from '@react-icons/all-files/vsc/VscMenu';
import { Button } from 'ariakit/button';
import type { Route } from 'next';
import dynamic from 'next/dynamic';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
@@ -23,7 +24,7 @@ export default function Header() {
.map((path, idx, original) => (
<Link
className="rounded outline-none hover:underline focus:ring focus:ring-width-2 focus:ring-blurple"
href={`/${original.slice(0, idx + 1).join('/')}`}
href={`/${original.slice(0, idx + 1).join('/')}` as Route}
key={`${path}-${idx}`}
>
{path}

View File

@@ -1,6 +1,7 @@
'use client';
import { allContents } from 'contentlayer/generated';
import type { Route } from 'next';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { Section } from './Section';
@@ -45,7 +46,7 @@ export function Sidebar() {
? 'bg-blurple text-white'
: 'dark:hover:bg-dark-200 dark:active:bg-dark-100 hover:bg-light-700 active:bg-light-800'
}`}
href={member.href}
href={member.href as Route}
key={`${member.title}-${index}`}
onClick={() => setOpened(false)}
title={member.title}

View File

@@ -1 +1,2 @@
NEXT_PUBLIC_LOCAL_DEV=true
METADATA_BASE_URL=http://localhost:3000

View File

@@ -7,7 +7,7 @@ const withBundleAnalyzer = bundleAnalyzer({
export default withBundleAnalyzer({
reactStrictMode: true,
experimental: {
appDir: true,
typedRoutes: true,
serverComponentsExternalPackages: ['@microsoft/api-extractor-model', 'jju'],
},
images: {
@@ -15,6 +15,7 @@ export default withBundleAnalyzer({
contentDispositionType: 'attachment',
contentSecurityPolicy: "default-src 'self'; frame-src 'none'; sandbox;",
},
poweredByHeader: false,
async redirects() {
return [
{

View File

@@ -49,9 +49,9 @@
"@discordjs/api-extractor-utils": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@discordjs/ui": "workspace:^",
"@microsoft/api-extractor-model": "7.27.6",
"@microsoft/tsdoc": "0.14.2",
"@planetscale/database": "1.7.0",
"@microsoft/api-extractor-model": "^7.27.6",
"@microsoft/tsdoc": "^0.14.2",
"@planetscale/database": "^1.11.0",
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^1.0.2",
"@vercel/edge-config": "^0.2.1",
@@ -61,7 +61,7 @@
"class-variance-authority": "^0.7.0",
"cmdk": "^0.2.0",
"meilisearch": "^0.34.1",
"next": "^13.4.17",
"next": "^13.4.19",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
@@ -75,15 +75,15 @@
"swr": "^2.2.1"
},
"devDependencies": {
"@next/bundle-analyzer": "^13.4.17",
"@next/bundle-analyzer": "^13.4.19",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "18.17.5",
"@types/node": "18.17.6",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@unocss/cli": "^0.55.1",
"@unocss/eslint-config": "^0.55.1",
"@unocss/reset": "^0.55.1",
"@unocss/cli": "^0.55.2",
"@unocss/eslint-config": "^0.55.2",
"@unocss/reset": "^0.55.2",
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-v8": "^0.34.2",
"concurrently": "^8.2.0",
@@ -92,12 +92,12 @@
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-formatter-pretty": "^5.0.0",
"happy-dom": "^10.10.2",
"lighthouse": "^10.4.0",
"prettier": "^2.8.8",
"happy-dom": "^10.10.4",
"lighthouse": "^11.0.0",
"prettier": "^3.0.2",
"turbo": "^1.10.12",
"typescript": "^5.1.6",
"vercel": "^31.4.0",
"vercel": "^32.0.0",
"vitest": "^0.34.2"
},
"engines": {

View File

@@ -1,9 +1,7 @@
'use client';
import { Analytics } from '@vercel/analytics/react';
import type { Metadata } from 'next';
import { Providers } from './providers';
import { DESCRIPTION } from '~/util/constants';
import { inter } from '~/util/fonts';
import '@unocss/reset/tailwind-compat.css';
@@ -11,68 +9,6 @@ import '~/styles/unocss.css';
import '~/styles/cmdk.css';
import '~/styles/main.css';
export const metadata: Metadata = {
title: 'discord.js',
description: DESCRIPTION,
viewport: {
minimumScale: 1,
initialScale: 1,
width: 'device-width',
},
icons: {
other: [
{
url: '/favicon-32x32.png',
sizes: '32x32',
type: 'image/png',
},
{
url: '/favicon-16x16.png',
sizes: '16x16',
type: 'image/png',
},
],
apple: [
'/apple-touch-icon.png',
{
url: '/safari-pinned-tab.svg',
rel: 'mask-icon',
},
],
},
manifest: '/site.webmanifest',
themeColor: [
{ media: '(prefers-color-scheme: light)', color: '#f1f3f5' },
{ media: '(prefers-color-scheme: dark)', color: '#1c1c1e' },
],
colorScheme: 'light dark',
appleWebApp: {
title: 'discord.js',
},
applicationName: 'discord.js',
openGraph: {
siteName: 'discord.js',
type: 'website',
title: 'discord.js',
description: DESCRIPTION,
images: 'https://discordjs.dev/api/open-graph.png',
},
twitter: {
card: 'summary_large_image',
creator: '@iCrawlToGo',
},
other: {
'msapplication-TileColor': '#1c1c1e',
},
};
export default function GlobalError({ error }: { readonly error: Error }) {
console.error(error);

View File

@@ -1,5 +1,6 @@
'use client';
import type { Route } from 'next';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
@@ -13,7 +14,7 @@ export default function NotFound() {
<h2 className="text-[2rem] md:text-[3rem]">Not found.</h2>
<Link
className="h-11 flex flex-row transform-gpu cursor-pointer select-none appearance-none place-items-center border-0 rounded bg-blurple px-6 text-base font-semibold leading-none text-white no-underline outline-none active:translate-y-px focus:ring focus:ring-width-2 focus:ring-white"
href={href}
href={href as Route}
>
Take me back
</Link>

View File

@@ -11,6 +11,9 @@ import '~/styles/cmdk.css';
import '~/styles/main.css';
export const metadata: Metadata = {
metadataBase: new URL(
process.env.METADATA_BASE_URL ? process.env.METADATA_BASE_URL : `http://localhost:${process.env.PORT ?? 3_000}`,
),
title: 'discord.js',
description: DESCRIPTION,
viewport: {

View File

@@ -1,3 +1,4 @@
import type { Route } from 'next';
import Link from 'next/link';
export default function NotFound() {
@@ -7,7 +8,7 @@ export default function NotFound() {
<h2 className="text-[2rem] md:text-[3rem]">Not found.</h2>
<Link
className="h-11 flex flex-row transform-gpu cursor-pointer select-none appearance-none place-items-center border-0 rounded bg-blurple px-6 text-base font-semibold leading-none text-white no-underline outline-none active:translate-y-px focus:ring focus:ring-width-2 focus:ring-white"
href="/docs"
href={'/docs' as Route}
>
Take me back
</Link>

View File

@@ -1,4 +1,5 @@
import { FiExternalLink } from '@react-icons/all-files/fi/FiExternalLink';
import type { Route } from 'next';
import Image from 'next/image';
import Link from 'next/link';
import vercelLogo from '~/assets/powered-by-vercel.svg';
@@ -24,7 +25,7 @@ export default function Page() {
<a className={buttonVariants()} href="https://old.discordjs.dev/#/docs" rel="noopener noreferrer">
Docs
</a>
<Link className={buttonVariants()} href="/docs">
<Link className={buttonVariants()} href={'/docs' as Route}>
Module docs
</Link>
<a

View File

@@ -5,6 +5,7 @@ import { VscGithubInverted } from '@react-icons/all-files/vsc/VscGithubInverted'
import { VscMenu } from '@react-icons/all-files/vsc/VscMenu';
import { VscSearch } from '@react-icons/all-files/vsc/VscSearch';
import { Button } from 'ariakit/button';
import type { Route } from 'next';
import dynamic from 'next/dynamic';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
@@ -27,7 +28,7 @@ export default function Header() {
.map((path, idx, original) => (
<Link
className="rounded outline-none hover:underline focus:ring focus:ring-width-2 focus:ring-blurple"
href={`/${original.slice(0, idx + 1).join('/')}`}
href={`/${original.slice(0, idx + 1).join('/')}` as Route}
key={`${path}-${idx}`}
>
{path}

View File

@@ -3,15 +3,11 @@
import type { LinkProps } from 'next/link';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import type { AnchorHTMLAttributes, PropsWithChildren, RefAttributes } from 'react';
import type { PropsWithChildren } from 'react';
import { useCurrentPathMeta } from '~/hooks/useCurrentPathMeta';
export interface ItemLinkProps
extends Omit<LinkProps, 'href'>,
RefAttributes<HTMLAnchorElement>,
Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps> {
export interface ItemLinkProps<T extends string> extends Omit<LinkProps<T>, 'href'> {
readonly className?: string;
/**
* The URI of the api item to link to. (e.g. `/RestManager`)
*/
@@ -30,7 +26,7 @@ export interface ItemLinkProps
* This component only needs the relative path to the item, and will automatically
* generate the full path to the item client-side.
*/
export function ItemLink(props: PropsWithChildren<ItemLinkProps>) {
export function ItemLink<T extends string>(props: PropsWithChildren<ItemLinkProps<T>>) {
const pathname = usePathname();
const { packageName, version } = useCurrentPathMeta();
@@ -40,5 +36,5 @@ export function ItemLink(props: PropsWithChildren<ItemLinkProps>) {
const { itemURI, packageName: pkgName, ...linkProps } = props;
return <Link href={`/docs/packages/${pkgName ?? packageName}/${version}/${itemURI}`} {...linkProps} />;
return <Link {...linkProps} href={`/docs/packages/${pkgName ?? packageName}/${version}/${itemURI}`} />;
}

View File

@@ -1,6 +1,7 @@
import type { ApiItem } from '@microsoft/api-extractor-model';
import type { DocComment, DocFencedCode, DocLinkTag, DocNode, DocNodeContainer, DocPlainText } from '@microsoft/tsdoc';
import { DocNodeKind, StandardTags } from '@microsoft/tsdoc';
import type { Route } from 'next';
import Link from 'next/link';
import { Fragment, useCallback, type ReactNode } from 'react';
import { ItemLink } from '../../ItemLink';
@@ -31,9 +32,8 @@ export function TSDoc({ item, tsdoc }: { readonly item: ApiItem; readonly tsdoc:
const { codeDestination, urlDestination, linkText } = tsdoc as DocLinkTag;
if (codeDestination) {
const foundItem = item
.getAssociatedModel()
?.resolveDeclarationReference(codeDestination, item).resolvedApiItem;
const foundItem = item.getAssociatedModel()?.resolveDeclarationReference(codeDestination, item)
.resolvedApiItem;
if (!foundItem) return null;
@@ -52,7 +52,7 @@ export function TSDoc({ item, tsdoc }: { readonly item: ApiItem; readonly tsdoc:
return (
<Link
className="rounded font-mono text-blurple outline-none focus:ring focus:ring-width-2 focus:ring-blurple"
href={urlDestination}
href={urlDestination as Route}
key={idx}
>
{linkText ?? urlDestination}