I am seeking solution to plan architecture to support new addon that can enhance the value of an existing web app. In current form, the solution is npm packages. We build npm packages that use the product's SDK to interact with its api but when we also want to have a ui component, it becomes a circular dependency. Also there are multiple common components copied across various packages that are common among all. The goal is to decouple tiny functionalities from the main codebase while maintaining the common functionalities in the core project. Appreciate your suggestions and resources.
And yes, specifically talking about plugin based architecture. Not just a code refactor. Decoupling is the first step and the plugins will be created by internal team initially, the next will be to ensure security when external users publish their own plugins. The tech stack is Node.js.