mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
fix(website): downgrade nextjs
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import 'server-only';
|
||||
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import { connect } from '@planetscale/database';
|
||||
import { cache } from 'react';
|
||||
|
||||
const sql = connect({ url: process.env.DATABASE_URL! });
|
||||
|
||||
@@ -13,7 +14,7 @@ export async function fetchVersions(packageName: string): Promise<string[]> {
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export const fetchModelJSON = cache(async (packageName: string, version: string): Promise<unknown> => {
|
||||
export async function fetchModelJSON(packageName: string, version: string): Promise<unknown> {
|
||||
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
|
||||
const res = await readFile(
|
||||
join(process.cwd(), '..', '..', 'packages', packageName, 'docs', 'docs.api.json'),
|
||||
@@ -35,4 +36,4 @@ export const fetchModelJSON = cache(async (packageName: string, version: string)
|
||||
|
||||
// @ts-expect-error: https://github.com/planetscale/database-js/issues/71
|
||||
return rows[0].data;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user