How do I include Angular Material components in my TypeDoc?

281 Views Asked by At

We already have TypeDoc included in our Storybook project and it works for our own components. We'd like to also have TypeDocs generated for the generic Material components.

I already fiddled around a lot with the --exclude argument for the typedoc but somehow I cant get it to work.

So far the entry in the package.json looks like this: "typedoc": "typedoc --mode modules --exclude **/*.spec.ts* --out build/typedoc --json build/typedoc/typedoc.json projects/" I tried around by adding --includeDeclarations to the statement and modifying the --exclude pattern to exclude everything under node_modules except node_modules/@angular/material but so far to no avail. For example I tried the pattern:

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

But I always get errors like

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

I've never worked with minimatch or typedoc so far so help is much appreciated.

Any ideas?

Update:

I was able to solve this by creating a typedoc.json file in the same directory as my package.json. The typedoc script now is: "typedoc --options ./typedoc.json projects/" and the content of typedoc.json is:

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

Behavior is as expected now.

0

There are 0 best solutions below