TypeDoc returns blank documentation for Express JS API

203 Views Asked by At

I'm trying to document my Express JS API using TypeDoc, but I get a rather empty documentation generated. enter image description here

This is my API file structure

enter image description here

This is my tsconfig.json:

 {
  "compilerOptions": {
    "target": "es5", 
    "module": "commonjs",
    "moduleResolution": "node", 
    "esModuleInterop": true, 
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true
  },
  "typedocOptions": {
    "entryPoints": ["server.ts"],
    "out": "docs"
  }
}

What am I doing wrong? All materials on the web point to adding the TypeDoc option {"mode": "modules}. But that's been deprecated. I would appreciate any guidance.

I ran npx typedoc and got empty documentation.

1

There are 1 best solutions below

0
SnowSenpai On

You can try using the "expand" entryPointStrategy option, then add "src/" to your entryPoints, that is assuming all the API code you wish to document is within that directory. You can keep your "server.ts" in the entryPoints option or move it into your "src/" directory. Here is an example:

{
  "entryPoints": ["src/"],
  "entryPointStrategy": "expand",
  "out": "./docs",
  "plugin": ["typedoc-theme-hierarchy"],
  "theme": "hierarchy",
  "name": "Node TypeScript API",
  "includeVersion": true,
  "readme": "none",
  "exclude": ["./src/tests/*"]
}

Visit npm for more info on typedoc-theme-hierarchy