-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(website): extract layouts and use more server components (#9027
- Loading branch information
1 parent
158db47
commit 39c4de2
Showing
73 changed files
with
1,830 additions
and
1,475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { readFile } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
|
||
export async function fetchVersions(packageName: string): Promise<string[]> { | ||
const response = await fetch(`https://docs.discordjs.dev/api/info?package=${packageName}`, { | ||
next: { revalidate: 3_600 }, | ||
}); | ||
|
||
return response.json(); | ||
} | ||
|
||
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'), | ||
'utf8', | ||
); | ||
return JSON.parse(res); | ||
} | ||
|
||
const response = await fetch(`https://docs.discordjs.dev/docs/${packageName}/${version}.api.json`, { | ||
next: { revalidate: 3_600 }, | ||
}); | ||
|
||
return response.json(); | ||
} |
Oops, something went wrong.
39c4de2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
discord-js – ./apps/website
discord-js-git-main-discordjs.vercel.app
discord-js-discordjs.vercel.app
discordjs.dev
www.discordjs.dev
discord-js-number-one.vercel.app
39c4de2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
discord-js-guide – ./apps/guide
discord-js-guide-discordjs.vercel.app
next.discordjs.guide
discord-js-guide.vercel.app
guide.discordjs.dev
discord-js-guide-git-main-discordjs.vercel.app