chore: update nextjs

This commit is contained in:
iCrawl
2024-05-24 01:47:07 +02:00
parent b36ec98382
commit f9ba11eba3
7 changed files with 1951 additions and 1236 deletions

View File

@@ -1,4 +1,5 @@
/* eslint-disable react/no-unknown-property */
import { ImageResponse } from 'next/og';
import { resolveKind } from '~/util/resolveNodeKind';

View File

@@ -1,7 +1,7 @@
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import rehypeShikiFromHighlighter from '@shikijs/rehype/core';
import { MDXRemote } from 'next-mdx-remote/rsc';
import { MDXRemote } from 'next-mdx-remote-client/rsc';
import remarkGfm from 'remark-gfm';
import { getHighlighterCore } from 'shiki/core';
import getWasm from 'shiki/wasm';
@@ -30,7 +30,7 @@ export default async function Page({ params }: { readonly params: { readonly pac
remarkPlugins: [remarkGfm],
rehypePlugins: [
[
rehypeShikiFromHighlighter as any,
rehypeShikiFromHighlighter,
highlighter,
{
themes: {

View File

@@ -20,11 +20,7 @@ export const viewport: Viewport = {
};
export const metadata: Metadata = {
metadataBase: new URL(
process.env.NEXT_PUBLIC_LOCAL_DEV === 'true'
? `http://localhost:${process.env.PORT ?? 3_000}`
: 'https://discord.js.org',
),
metadataBase: new URL(ENV.IS_LOCAL_DEV ? `http://localhost:${ENV.PORT}` : 'https://discord.js.org'),
title: {
template: '%s | discord.js',
default: 'discord.js',

View File

@@ -1,4 +1,5 @@
export const ENV = {
IS_LOCAL_DEV: process.env.VERCEL_ENV === 'development' || process.env.NEXT_PUBLIC_LOCAL_DEV === 'true',
IS_PREVIEW: process.env.VERCEL_ENV === 'preview',
PORT: process.env.PORT ?? 3_000,
};