I manage a monorepo using lerna
in conjunction with npm
. My goal is to determine if it's possible to selectively execute a lerna
command based on where changes have been made.
For instance: I have the following packages:
package-common-base
package-a
package-b
If a change occurs in package-common-base
, I want to run lerna run test
.
If a change occurs in either package-a
or package-b
(but not in package-common-base
), I'd like to run lerna run test:unit
.
I've experimented with various approaches involving lerna
flags and also explored @lerna/filter-options
, but so far haven't found a solution that fits this specific scenario.
It's possible my understanding of the situation isn't correct, but this feature would be valuable to me, particularly when I need to limit or broaden the scope of running tests based on changes to critical packages...
Cheers,