I’m trying to make the following work:
npm install && npm run-script buildcompiles it to some
I’ve packaged this up as a nix package. Its output is that
projectA. This is currently encoded by having
package.json; now I can build
projectBagainst the version of
projectAthat happens to have been built locally. This kind of works for development but is clearly a bit of a mess.
I don’t know how to package this as a nix package. (Well, I’ve hacked around it by checking in the build output for now.)
What I would like is to be able to have
projectB depend on
projectA on a nix level. E.g. when using flakes, make the
projectA git repo an input to
projectB. (While also dealing with regular npm dependencies somewhat conveniently.) Does anyone have an example of a setup like this? Is it a bad idea?
(I think what I’m fundamentally struggling with is that npm doesn’t build dependencies, but only copies them over. So it expects me to either release the build output of
projectA somewhere before I can depend on it, or to depend on the source of
projectA directly. Does that seem accurate?)