Wednesday, 2 September 2020

Bundling choice dependencies before pushing distro to machine for further build

I have a yarn workspace directory structure like so:monorepo/ └── packages/ ├── core/ │ └── package.json └── distro/ └── package.jsonDistro uses code from core by requiring core through workspaces (which I believe uses npm linkunder the hood). Neither core or distro will ever be published; but distro does need to be 'built' on different machines (some of its' dependencies use make commands to build for correct architectures). Core is pretty agnostic.In a situation where I would like to push distro to (say) an IOT machine for building, the IOT machine no longer has access to packages/core as it is a yarn workspace. I could push the whole monorepo, but then I'm forcing the machine to 1) store some code that won't be used (there are other packages in the monorepo) and 2) forcing the machine to use yarn over npm.Similarly, I can't build the distro locally and then push because (as mentioned earlier) certain external dependencies do require building for specific architectures.Aside from the more general question of "how would you go about managing this?", I guess a more direct question would be; is there a build system that would allow me to bundle some local dependencies together into a build (distro + core) while being flexible enough to install the external dependencies as they are needed from the IOT machine? Interested to know how would others go about managing this?

Submitted September 02, 2020 at 11:47AM by shennan_

No comments:

Post a Comment