Nx/Nrwl - Angular Ui Library: How to construct the library-tree?

427 Views Asked by At

Im starting a ui library inside my nx monorepo but Im unsure how to best organize it. I have thought about these options:

  • (1) a UI Library for each UI Component, where each Component has its own container module.
  • (2) a UI Library for each UI Type, where there is one Module containing multiple component categories
  • (3) a UI Library for each UI Type, where there is one Module for each component category
  • (4) one UI Library for all Ui Components, where it contains a module for each ui component
  • (5) one UI Library for all Ui Components, where we again have categorized the ui component types, bundling into modules

Here are showcases what I mean:

  1. a UI Library for each UI Component, where each Component has its own container module. enter image description here

  2. a UI Library for each UI Type, where there is one Module containing multiple component categories: enter image description here

  3. a UI Library for each UI Type, where there is one Module for each component category: enter image description here

  4. one UI Library for all Ui Components, where it contains a module for each ui component:enter image description here

  5. one UI Library for all Ui Components, where we again have categorized the ui component types, bundling into modules:

    enter image description here

  • Which option should I go for?
  • What structure do you prefer?
  • What is better and why?
  • Are there other solutions?

Thank you in advance

0

There are 0 best solutions below