-
Notifications
You must be signed in to change notification settings - Fork 7
/
typedoc.config.cjs
47 lines (43 loc) · 1.55 KB
/
typedoc.config.cjs
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
// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/no-require-imports */
const { readFileSync } = require("fs");
const { sync: fastGlobSync } = require("fast-glob");
const { dirname } = require("path");
const DEFAULT_HIGHLIGHT_LANGS = require("typedoc").OptionDefaults.highlightLanguages;
const documentedPackages = getPackageDirectories().sort();
console.info("Creating documentation for packages:", documentedPackages);
/**
* See https://typedoc.org/options/
*
* @type {import("typedoc").TypeDocOptions}
*/
module.exports = {
name: "Open Pioneer Trails Packages",
readme: "none",
out: "dist/docs",
entryPointStrategy: "packages",
entryPoints: documentedPackages,
skipErrorChecking: true,
validation: {
notExported: false,
invalidLink: true,
notDocumented: true
},
// 'tsx' is in default, but 'jsx' is not..
highlightLanguages: [...DEFAULT_HIGHLIGHT_LANGS, "jsx"]
};
function getPackageDirectories() {
const packageJsonPaths = fastGlobSync("./src/packages/**/package.json", {
ignore: ["**/dist/**", "**/node_modules/**"],
followSymbolicLinks: false
});
const packageDirectories = packageJsonPaths
.filter((path) => {
const packageJsonContent = JSON.parse(readFileSync(path, "utf-8"));
const isPrivate = !!packageJsonContent.private;
return !isPrivate;
})
.map((path) => dirname(path));
return packageDirectories;
}