Suppose a Node app which is a "micro-UI". So it has its own UI components, maybe some Redux stuff, some classes to make API calls, etc.
I have need to export some part of this repo for consumption in other micro-UIs:
my-project-api NPM package.my-project-ui NPM package.In other micro-UIs where I need the API classes from this repo (but not the UI components), I'll install my-project-api via NPM.
In the "main UI" project which gathers all micro-UIs and build a single SPA from them, I'll install my-project-ui via NPM.
So, my package.json needs to support publishing multiple package (e.g. the name field needs to be flexible). How can this be accomplished without splitting the API source from the non-API source?
I think the answer is likely to split out the API components / UI components into their own packages in the same repo. But I'm wondering if there's another way.