question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE] Generate documentation for multiple libraries contained within a monorepo

See original GitHub issue
Overview of the feature

It would be nice if there were a way to specify library inputs, maybe through public-api.ts in individual libraries, that would allow for the generated documentation to indicate which library has the associated available content. By this I mean, if I have a monorepo that is namespaced for multiple libraries to be published, it would be helpful if the generated documentation placed all associated functions, variables, components, modules, etc. to a particular library under a single heading, while still allowing the documentation to be combined for all libraries.

Motivation for or Use Case

While there is already a way to generate documentation for multiple apps and for combining the documentation for those apps, there isn’t any real support for documenting multiple publishable libraries.

For example:

projects
  - my-lib-1
    - something.component.ts
    - something.funcs.ts
    - my-lib-1.module.ts
    - my-other-module.ts
    - public-api.ts
  - my-lib-2
    - something-else.component.ts
    - something-else.funcs.ts
    - my-lib-2.module.ts
    - my-other.funcs.ts
    - public-api.ts

As of right now, creating a single tsconfig.compodoc.json file to include these will result in

Modules
  - MyLib1Module
    - Components
      - SomethingComponent
  - MyLib2Module
    - Components
      - SomethingElseComponent
  - MyOtherModule
Misc.
  - Functions
    - something.funcs
    - something-else.funcs
    - my-other.funcs

There really isn’t a way to determine which library the modules are coming from, especially if there are sub-modules contained within the libraries. Further, there isn’t a clean way of knowing which library contains which functions since they’re all just listed out. A user would have to dig through all of the functions to find the ones that are relevant to the library they’re using.

Ideally, a better solution might be:

Libraries
  - my-lib-1
    Modules
      - MyLib1Module
        - Components
          - SomethingComponent
      - MyOtherModule
    Functions/Misc
      - something.funcs
  - my-lib-2
    Modules
      - MyLib2Module
        - Components
          - SomethingElseComponent
    Functions/Misc
      - something-else.funcs
      - my-other.funcs

This allows libraries that are related to be combined into a single set of documentation and also allow for functions to be associated to the appropriate libraries. There is less digging to find what functions are available and how they may work within a given library. And this is even more useful if one of the provided libraries does not necessarily have any angular modules or components and is just a utility library of sorts.

Related issues

No related issues that I’m aware of.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
Yakoustcommented, Sep 7, 2021

Sad that this issue is closed. It is a really good idea.

I am facing same problem with an NX monorepo for libraries. As a workaround, I build as many documentation as library. Obviously, it is not very clean, especially because assets are duplicated.

Is there any specific plan for monorepo / workspace use case @vogloblinsky ?

0reactions
stale[bot]commented, Dec 12, 2020

This issue has been automatically closed because it has not had recent activity. Please file a new issue if you are encountering a similar or related problem. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Guide to Monorepos for Front-end Code
A monorepo or monorepository is a code management and architectural concept whereby you keep all your isolated bits of code inside one super...
Read more >
11 Great Tools for a Monorepo in 2021 | Bits and Pieces
Best tools to build a monorepo. Develop, build, and publish packages, and scale development. Discover Lerna, Nx, Rush, Bit, Yarn Workspaces, and more....
Read more >
Monorepos
A monorepo is a single git repository that holds the source code for multiple applications and libraries, along with the tooling for them....
Read more >
How to Create a Monorepo for Multiple Node Packages
In this post, I will walk you through how to use Lerna to manage, and publish, two packages under the same monorepo.
Read more >
Monorepo vs Multi-Repo: Pros and Cons of Code ...
The monorepo approach uses a single repository to host all the code for the multiple libraries or services composing a company's projects. At ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found