-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathtypedoc.config.js
More file actions
83 lines (77 loc) · 2.7 KB
/
Copy pathtypedoc.config.js
File metadata and controls
83 lines (77 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* SPDX-FileCopyrightText: 2025 Pagefault Games
* SPDX-FileContributor: Bertie690
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
/// <reference path="./global.d.ts" />
import { globSync } from "node:fs";
const dryRun = !!process.env.DRY_RUN?.match(/true/gi);
/**
* <!-- @satisfies {Partial<import("typedoc").TypeDocOptions>} -->
*/
const config = {
entryPoints: ["./src", "./test/framework", "./test/helpers", "./test/matchers", "./test/utils"],
entryPointStrategy: "expand",
exclude: [
"src/polyfills.ts",
"src/extensions.ts",
"src/vite.env.d.ts",
"**/*+.test.ts",
"**/*+.test-d.ts",
"test/setup",
"test/reporters",
"test/@types/matcher-helpers.ts",
"test/@types/vitest.d.ts",
],
excludePrivate: false, // Private members are useful in the docs for contributors
excludeReferences: true, // prevent documenting re-exports
requiredToBeDocumented: [
"Enum",
"EnumMember",
"Variable",
"Function",
"Class",
"Interface",
"Property",
"Method",
"Accessor",
"TypeAlias",
],
highlightLanguages: ["javascript", "json", "jsonc", "json5", "tsx", "typescript", "markdown"],
plugin: [
"typedoc-github-theme",
"typedoc-plugin-coverage",
"typedoc-plugin-mdn-links",
"typedoc-plugin-missing-exports",
...globSync("./plugins/typedoc/**/*.js").map(plugin => "./" + plugin),
],
// Avoid emitting docs for branches other than main/beta
emit: dryRun ? "none" : "docs",
out: process.env.CI ? "/tmp/docs" : "./typedoc",
name: "PokéRogue",
readme: "./README.md",
projectDocuments: ["docs/*.md", "CONTRIBUTING.md"],
coverageLabel: "Documented",
coverageSvgWidth: 120, // Increased from 104 baseline due to adding 2 extra letters
favicon: "./favicon.ico",
theme: "typedoc-github-theme",
customFooterHtml: `<p>Copyright <strong>Pagefault Games</strong> ${new Date().getFullYear() === 2025 ? "2025" : "2025 - " + new Date().getFullYear()}</p>`,
customFooterHtmlDisableWrapper: true,
navigationLinks: {
GitHub: "https://github.com/pagefaultgames/pokerogue",
},
includeDocCommentReferences: true,
placeInternalsInOwningModule: true,
};
// If generating docs for main/beta, check the ref name and add an appropriate navigation header
if (!dryRun && process.env.REF_NAME) {
const otherRefName = process.env.REF_NAME === "main" ? "beta" : "main";
config.navigationLinks = {
...config.navigationLinks,
// This will be "Switch to Beta" when on main, and vice versa
[`Switch to ${otherRefName.charAt(0).toUpperCase() + otherRefName.slice(1).toLowerCase()}`]: `https://pagefaultgames.github.io/pokerogue/${otherRefName}`,
};
}
// biome-ignore lint/style/noDefaultExport: required by TypeDoc
export default config;