如何在TypeDoc中包含Angular Material组件?

时间:2019-11-05 14:24:49

标签: angular typescript glob minimatch typedoc

我们的Storybook项目中已经包含TypeDoc,它可用于我们自己的组件。我们还希望为通用Material组件生成TypeDocs。

我已经在Typedoc的--exclude参数中摆弄了很多东西,但是不知怎么使它无法正常工作。

到目前为止,package.json中的条目如下所示: "typedoc": "typedoc --mode modules --exclude **/*.spec.ts* --out build/typedoc --json build/typedoc/typedoc.json projects/" 我尝试通过在语句中添加--includeDeclarations并修改--exclude模式,以排除node_modules之外node_modules/@angular/material下的所有内容,但至今无济于事。 例如,我尝试了以下模式:

**/{node_modules/!(@angular/material)/**,*.spec.ts}

但是我总是会收到类似的错误

"/**" kann syntaktisch an dieser Stelle nicht verarbeitet werden.

到目前为止,我从未使用过minimatch或typedoc,因此非常感谢您的帮助。

有什么想法吗?

更新:

我能够通过在与typedoc.json相同的目录中创建一个package.json文件来解决此问题。现在,typedoc脚本为: "typedoc --options ./typedoc.json projects/"typedoc.json的内容为:

{
    "out": "build/typedoc",
    "json": "build/typedoc/typedoc.json",
    "mode": "modules",
    "includeDeclarations": true,
    "exclude": [
        "**/*.spec.ts",
        "**/node_modules/!(@angular)/**",
        "**/node_modules/@angular/!(material)/**"
    ]
}

行为符合预期。

0 个答案:

没有答案