-
Notifications
You must be signed in to change notification settings - Fork 309
/
Copy pathtypedoc.config.mjs
60 lines (54 loc) · 1.77 KB
/
typedoc.config.mjs
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
import path from 'node:path';
import fs from 'node:fs';
import { OptionDefaults } from 'typedoc';
const IGNORE_LIST = [
'.DS_Store',
'dev-cli',
'expo-passkeys',
'tailwindcss-transformer',
'testing',
'themes',
'ui',
'upgrade',
];
/**
* Return an array of relative paths to all folders in the "packages" folder to be used for the "entryPoints" option.
*/
function getPackages() {
const packagesDir = path.resolve('packages');
const packages = fs.readdirSync(packagesDir);
return packages.filter(dir => !IGNORE_LIST.includes(dir)).map(dir => path.join('packages', dir));
}
/** @type {import("typedoc-plugin-markdown").PluginOptions} */
const typedocPluginMarkdownOptions = {
hidePageHeader: true,
hideBreadcrumbs: true,
hidePageTitle: true,
};
/** @type {Partial<import("typedoc").TypeDocOptions>} */
const config = {
out: './.typedoc/docs',
// TODO: Once we're happy with the output the JSON should be written to a non-gitignored location as we want to consume it in other places
json: './.typedoc/output.json',
entryPointStrategy: 'packages',
plugin: ['typedoc-plugin-markdown'],
packageOptions: {
includeVersion: false,
excludePrivate: true,
sortEntryPoints: true,
sort: 'alphabetical',
excludeExternals: true,
excludeInternal: true,
excludeNotDocumented: true,
gitRevision: 'main',
blockTags: [...OptionDefaults.blockTags, '@warning', '@note', '@important', '@memberof'],
modifierTags: [...OptionDefaults.modifierTags],
exclude: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
readme: 'none',
disableGit: true,
disableSources: true,
},
entryPoints: ['packages/nextjs', 'packages/react', 'packages/shared', 'packages/types'], // getPackages(),
...typedocPluginMarkdownOptions,
};
export default config;