Skip to content

Commit

Permalink
⚙️ config(utils): 测试 typedoc.config.mjs 。可以使用。
Browse files Browse the repository at this point in the history
  • Loading branch information
ruan-cat committed Nov 29, 2024
1 parent 8f74074 commit baa65af
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"copy-readme": "cpx readme.md docs",
"copy-changelog": "cpx CHANGELOG.md docs",
"typedoc": "typedoc --options typedoc.config.cjs",
"typedoc": "typedoc --options typedoc.config.mjs",
"prettier-docs-(invalid)": "prettier docs/**/*.md --write",
"docs:dev-main": "vuepress-vite dev docs",
"docs:dev": "turbo docs:dev",
Expand Down
43 changes: 43 additions & 0 deletions packages/utils/typedoc.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @ts-check

/**
* @type {import('typedoc').TypeDocOptions & import('typedoc-plugin-markdown').PluginOptions}
*
* 允许使用 `typedoc.config.mjs` 作为配置文件
* @see https://typedoc.org/documents/Options.Configuration.html#options
*
* 类型声明配置
* @see https://typedoc-plugin-markdown.org/docs/typedoc-usage#javascript-files
*/
// @ts-ignore
const config = {
name: "本地化示例",
// 指定项目的入口点
entryPoints: ["./src/index.ts"],
plugin: ["typedoc-plugin-markdown"],
// 指定输出目录
out: "./docs/typedoc-md",
// 排除不需要生成文档的目录
exclude: ["node_modules", "libs"],
// 指定 TypeScript 配置文件
tsconfig: "./tsconfig.json",
gitRevision: "main",
lang: "zh",
excludeExternals: true,
excludePrivate: true,
excludeProtected: true,
// 不需要专门移动readme文件
readme: "none",
// "readme": "readme.md",
hidePageHeader: true,
hideBreadcrumbs: true,
enumMembersFormat: "table",
parametersFormat: "table",
propertiesFormat: "table",
typeDeclarationFormat: "table",
indexFormat: "table",
useCodeBlocks: true,
expandObjects: true,
};

export default config;

0 comments on commit baa65af

Please sign in to comment.