5

I started to use compodoc + storybook in a Angular 9 project.

Installed all the dependencies and Storybook is working fine, but for some reason the documentation.json generated by compodoc is empty, like this:

{
    "pipes": [],
    "interfaces": [],
    "injectables": [],
    "classes": [],
    "directives": [],
    "components": [],
    "modules": [],
    "miscellaneous": [],
    "routes": [],
    "coverage": {
        "count": 0,
        "status": "low",
        "files": []
    }
}

The command I'm using is:

compodoc -p .storybook/tsconfig.json -e json -d ./.storybook

And my tsconfig.json is:

{
  "extends": "../src/tsconfig.app.json",
  "compilerOptions": {
    "types": [
      "node"
    ]
  },
  "exclude": [
    "../src/test.ts",
    "../src/**/*.spec.ts",
    "../projects/**/*.spec.ts"
  ],
  "include": [
    "../src/**/*",
    "../projects/**/*"
  ],
  "files": [
    "./typings.d.ts"
  ]
}

Any ideas of what may be wrong?

2
  • Did you have any progress? Commented May 11, 2020 at 2:27
  • @Dekim Not yet. It seems to be a bug. Unfortunately. :( github.com/compodoc/compodoc/issues/951 Commented May 11, 2020 at 18:33

3 Answers 3

11

After switching from -p tsconfig.app.json to -p tsconfig.json it worked. We have both files, but I think compodoc does not understand that tsconfig.app.json extends the tsconfig.json file since both are written in JSON and there is no such thing as dependency.

Source

Sign up to request clarification or add additional context in comments.

1 Comment

Well, that did the trick. My command became: compodoc -p tsconfig.json -e json -d ./.storybook and now it works!
6

Use tsconfig.base.json instead of tsconfig.json

1 Comment

The accepted answer did not work for me, but this. Angular 10, newly created project.
0

What worked for me was having this in the package.json.

"docs:json": "compodoc -p tsconfig.json -e json -d ."

Our team uses a separate project for the Angular library and the Storybook in another. We just make sure the documentation.json for both of the projects is always the same.

And, we switched off the compodoc flag in storybook so it doesn't try to overwrite what we pasted.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.