문서화 라이브러리 추천 (Recommend Angular Documentation Tool - compodoc)

최대 1 분 소요

Angular developers often seek automated documentation tools akin to JSDoc.

Compodoc is a valuable library to consider in this context.

It expertly parses Angular routing configurations, including lazy-loaded modules, to generate comprehensive documentation. Compodoc meticulously details module structures, component compositions, and the variables and functions utilized within components, providing a nearly complete, automatically generated documentation set.

Installation

npm install @compodoc/compodoc --save-dev

Execution

Specify the path to your tsconfig.app.json file.

npx compodoc -p src/tsconfig.app.json

Official documentation recommends adding a script to package.json for ease of use (requires npm version 6 or higher).

"scripts": {
  "compodoc": "npx compodoc -p src/tsconfig.app.json"
}

Execute the documentation generation using:

npm run compodoc

Update (2021-07-12)

  • Resolved Lazy Loading issues.
  • However, using async await within the routes configuration for Lazy Loading, as illustrated below, still triggers an error.
{
  path: 'test',
  loadChildren: async () =>
    await (import('/test/test.module')).TestModule
},

References

댓글남기기