Skip to content

Commit

Permalink
fix(typedoc): make typedoc generate process synchronize
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Jan 16, 2022
1 parent 6e33125 commit d993e68
Show file tree
Hide file tree
Showing 24 changed files with 609 additions and 984 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

- 交互式配置: `cea` 提供交互式的命令行完成用户及学校的配置,同时也支持使用 `toml` 文件来配置

- 验证持久化: 缓存验证信息于本地, 只在失效时登录并更新;云端和本地缓存能力来源于我的另一个项目 [sstore](https://github.com/beetcb/sstore)
- 验证持久化: 缓存验证信息于本地, 只在失效时登录并更新;

- 多用户非阻塞: 利用 Node.js 异步特征,多用户可并行,实现毫秒级的多用户同时操作

Expand Down Expand Up @@ -124,7 +124,9 @@ cea.start()
## 插件列表
- [`cea-check-in`](./docs/api/plugins/check-in/README.md)
- [`check-in-helper`](./docs/api/plugins/check-in/README.md)
- [`attendance`](./docs/api/plugins/attendance/README.md)
- [`sign`](./docs/api/plugins/sign/README.md)
## 贡献指南
Expand Down Expand Up @@ -157,9 +159,10 @@ log.notify()
感谢同类项目的存在,让社区能够相互学习和进步:
- [CarltonHere/auto-cpdaily](https://github.com/CarltonHere/auto-cpdaily)
- [AntaresQAQ/campushoy-auto-sign](https://github.com/AntaresQAQ/campushoy-auto-sign)
- [ZimoLoveShuang/auto-submit](https://github.com/ZimoLoveShuang/auto-submit)
- [AntaresQAQ/campushoy-auto-sign](https://github.com/AntaresQAQ/campushoy-auto-sign)
- [windowsair/fzu-cpDailySign](https://github.com/windowsair/fzu-cpDailySign)
- [CarltonHere/auto-cpdaily](https://github.com/CarltonHere/auto-cpdaily)
## 声明
Expand Down
19 changes: 11 additions & 8 deletions build/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@ async function main() {
}

const pkgRefs: Array<PackageRefs> = tsconfig.references
const isPluginPackage = (is: boolean) =>
console.log(pkgRefs)
const isPluginPackage =
(is: boolean) =>
({ path }: any) =>
is ? path.includes('/plugins/') : !path.includes('/plugins/')

// asynchronizedly build non-plugins api docs
build(pkgRefs.filter(isPluginPackage(false)))
// asynchronizedly build plugins api docs
build(pkgRefs.filter(isPluginPackage(true)))
// synchronizedly build non-plugins api docs
await build(pkgRefs.filter(isPluginPackage(false)))
// synchronizedly build plugins api docs
await build(pkgRefs.filter(isPluginPackage(true)))
}

function build(refs: Array<PackageRefs>) {
async function build(refs: Array<PackageRefs>) {
for (const { path } of refs) {
console.log(path)
const app = new TypeDoc.Application()
// If you want TypeDoc to load tsconfig.json / typedoc.json files
app.options.addReader(new TypeDoc.TSConfigReader())
app.options.addReader(new TypeDoc.TypeDocReader())
const pkgName = path.slice(1)
const pkgName = path.slice(-1)
app.bootstrap({
// typedoc options here
entryPoints: [`${path}src/index.ts`],
Expand All @@ -48,7 +51,7 @@ function build(refs: Array<PackageRefs>) {
// Project may not have converted correctly
const outputDir = `docs/api${pkgName}`
// Rendered docs
app.generateDocs(project, outputDir)
await app.generateDocs(project, outputDir)
}
}
}
Expand Down
File renamed without changes.
File renamed without changes.
15 changes: 0 additions & 15 deletions docs/api/core/README.md

This file was deleted.

247 changes: 0 additions & 247 deletions docs/api/core/modules.md

This file was deleted.

Loading

0 comments on commit d993e68

Please sign in to comment.