I am developing 2 node.js packages, each managed in their own git repository. Package B
depends on package A
, so my local directory structure looks like this:
A1/
B/
node_modules/
A2/
If I make a change to the local code of A1
, I would like to test it with B
before pushing it to the public repository. How can I do this?
In it's current state, B
has it's own local copy (A2
), so it is referencing a different version. B
is a public package, so I would like to avoid directly modifying the source code of B
to reference A1
.
One possible solution is to have 2 local copies of B
: B1
is the released, public version that has it's own local dependency on A2
, and B2
is my own private version that directly references A1
using something like require('./../A1')
.
A1/
B1/
node_modules/
A2/
B2/
This seems kind of ugly (and would force me to maintain 2 copies of B
), and I'm wondering if there's a recommended way to handle this situation?
Thanks.