We have a library of shared UI components like buttons and inputs. How should we structure this? Should it be its own repo (monorepo) or just a folder in the main app? I want to make sure it stays isolated so that we don't accidentally leak domain logic into our design system.
A monorepo structure provides the most effective isolation for shared UI components by utilizing workspace dependency management to prevent the entanglement of domain logic.
1 answer
A dedicated monorepo using a tool like Nx or Turborepo is the optimal architectural choice for isolating UI components while maintaining scalability. This approach enforces strict boundary conditions between your core application logic and the shared design system through workspace dependency rules.
I am so sorry to bother you, Salvador Beck, but your mention of Nx is really stressing me out because I haven't even finished my first coffee yet, though it sounds technically sound.