[Dev] Fix typedoc.config.js (#6495)

This commit is contained in:
Bertie690 2025-09-05 23:27:21 -04:00 committed by GitHub
parent e94417940f
commit 2d037fca96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,7 @@
import { globSync } from "node:fs"; import { globSync } from "node:fs";
const dryRun = !!process.env.DRY_RUN.match(/true/gi);
/** /**
* @type {Partial<import("typedoc").TypeDocOptions>} * @type {Partial<import("typedoc").TypeDocOptions>}
*/ */
@ -28,7 +30,7 @@ const config = {
...globSync("./typedoc-plugins/**/*.js").map(plugin => "./" + plugin), ...globSync("./typedoc-plugins/**/*.js").map(plugin => "./" + plugin),
], ],
// Avoid emitting docs for branches other than main/beta // Avoid emitting docs for branches other than main/beta
emit: process.env.DRY_RUN ? "none" : "docs", emit: dryRun ? "none" : "docs",
out: process.env.CI ? "/tmp/docs" : "./typedoc", out: process.env.CI ? "/tmp/docs" : "./typedoc",
name: "PokéRogue", name: "PokéRogue",
readme: "./README.md", readme: "./README.md",
@ -44,7 +46,7 @@ const config = {
}; };
// If generating docs for main/beta, check the ref name and add an appropriate navigation header // If generating docs for main/beta, check the ref name and add an appropriate navigation header
if (!process.env.DRY_RUN && process.env.REF_NAME) { if (!dryRun && process.env.REF_NAME) {
const otherRefName = process.env.REF_NAME === "main" ? "beta" : "main"; const otherRefName = process.env.REF_NAME === "main" ? "beta" : "main";
config.navigationLinks = { config.navigationLinks = {
...config.navigationLinks, ...config.navigationLinks,