So I had a case similar to this once. In a company that I worked with, we had created because of our own library of components, and as new projects were emerging, we had to copy all the components.
To improve maintenance, update these components, and not always have to perform this manual copy, we choose to do the following:
- Select all components that will be reusable between projects;
- Refactor all selected components so they have no business logic/rule inside them;
- Create a separate project/repository for them;
- Create a development environment for this new repository, in this case we use Storybook (visual testing, development and documentation), unit testing with Jest, and regression testing with Pupeteer/Jest;
- With the components ready and tested, we created a script to carry out its installation, to install this new library of components, in the Vuetify/Buefy style;
- Since it was a client and private components, we climbed onto a server with Nexus, but if it didn’t have to be private, it could go up on npm;
- We erased all components that were copied in the projects;
- We have installed this new component library in all projects;
Now when we need to add a new component, new Feature, or change, we change it in the library (if it’s something reusable), and upload a new version, then just update the projects that are using it.
I hope I’ve helped.