mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
feat(api-extractor): support multiple entrypoints (#10829)
* feat(api-extractor): support multiple entrypoints * chore: initial support in generateSplitDocumentation * chore: bring in line with upstream * refactor: multiple entrypoints in scripts * fix: split docs * feat: website * fix: docs failing on next * fix: don't include dtypes for now * refactor: don't fetch entrypoint if there is none --------- Co-authored-by: iCrawl <buechler.noel@outlook.com>
This commit is contained in:
@@ -3,15 +3,22 @@ import { join } from 'node:path';
|
||||
import { ENV } from './env';
|
||||
|
||||
export async function fetchSitemap({
|
||||
entryPoint,
|
||||
packageName,
|
||||
version,
|
||||
}: {
|
||||
readonly entryPoint?: string | undefined;
|
||||
readonly packageName: string;
|
||||
readonly version: string;
|
||||
}) {
|
||||
const normalizedEntryPoint = entryPoint ? `${entryPoint}.` : '';
|
||||
|
||||
if (ENV.IS_LOCAL_DEV) {
|
||||
const fileContent = await readFile(
|
||||
join(process.cwd(), `../../packages/${packageName}/docs/${packageName}/split/${version}.sitemap.api.json`),
|
||||
join(
|
||||
process.cwd(),
|
||||
`../../packages/${packageName}/docs/${packageName}/split/${version}.${normalizedEntryPoint}sitemap.api.json`,
|
||||
),
|
||||
'utf8',
|
||||
);
|
||||
|
||||
@@ -20,7 +27,7 @@ export async function fetchSitemap({
|
||||
|
||||
const isMain = version === 'main';
|
||||
const fileContent = await fetch(
|
||||
`${process.env.BLOB_STORAGE_URL}/rewrite/${packageName}/${version}.sitemap.api.json`,
|
||||
`${process.env.BLOB_STORAGE_URL}/rewrite/${packageName}/${version}.${normalizedEntryPoint}sitemap.api.json`,
|
||||
{
|
||||
next: { revalidate: isMain ? 0 : 604_800 },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user