Allow lerna publish to not update dependency package.jsons if they do not match semvers
See original GitHub issueExpected Behavior
If I have a monorepo with package A and B, where A depends on B, I want to be able to hard code the version of B that A depends on if there is a bug in B. For example, if A’s package.json normally contains this:
B: "^4.5.6
but then B@4.5.7 contains a bug, I would like to move forward with the version of A while hard coding B to 4.5.6
B: "4.5.6"
And then I’d like B to remain at 4.5.6 until I manually add a caret back in. This way if B gets updated with a different change that does not fix the bug, I don’t accidentally pull it into A.
Current Behavior
If I hard code A to B@4.5.6, any change to B will bump A’s version.
Possible Solution
There’s an argument to be made that if the new version of B does not match A’s old semver, A’s version of B should not be bumped. But since that would be a breaking change, I think a good middle ground would be to enable this behavior only with an option to publish. Something like --respect-semvers
or something.
Context
I work on a project with many teams, and we want to easily be able to move forward with development if one the libraries in our monorepo has a bug in it. We typically hard code the version of that library to the last working version if a bug is released, but this would not work if we tried to use lerna publish (because we can’t always fix the broken dependency right away).
Your Environment
Executable | Version |
---|---|
lerna --version |
2.11.0 |
node --version |
9.11.0 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
It sounds like A and B in your example shouldn’t be living in the same monorepo. How did B’s bug not break A’s unit/integration tests?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.