Repository navigation
Add support for hidden '--exact' flag - #426
Conversation
|
Want to add a test? |
|
Yeah... |
|
@thejameskyle added a case that tests that it only applies to revised release versions and not diverged ones. |
|
|
||
| if (deps[depName] && version) { | ||
| deps[depName] = "^" + version; | ||
| deps[depName] = this.flags.exact ? version : "^" + version; |
There was a problem hiding this comment.
It's not obvious to me just looking at this that it works.
I mean, I know it does (thanks to your tests), but I'm not confident about operator precedence between ?: and +. This would be a clearer for me with a set of parentheses.
There was a problem hiding this comment.
I think you might have read it wrong. It's just a ternary operator
const a = someFlag ? 1 : 2;
Sets a to 1 if someFlag is true and 2 if it's false.
There was a problem hiding this comment.
I think to understand properly you need to know arity of operators, so it can become confusing for some people. You can read it both as
(this.flags.exact ? version : "^") + version;
and
this.flags.exact ? version : ("^" + version);
|
@L8D Why is this a hidden option? Or, asked another way, what makes this option useful? Could you write that down as documentation so other users could more easily benefit from it? |
|
Does it solve this issue #359 ? |
|
@Gongreg Yeah it looks like it does. Thanks for making that connection! |
|
We'd love to have this one in too, since we never use If Lerna supports |
|
Just to add, this should be the default when using the If the canary flag check was added I think this would solve the underlying issue with #277 |
This allows for users to opt to use exact versions of cross-dependencies when publishing.
|
@gigabo @thejameskyle Any idea on when this may be merged into master? This feature definitely is useful when trying to manage multi-dependency builds across different environments. |
I guess this could be a diff feature request. Are we still making this hidden? if it solves #359 we such document in the readme? |
|
@hzoo I originally made it "hidden" because I wasn't gonna spend time writing documentation for it in this PR. If someone is up for documenting it that'd be great but I'm using this patched version of lerna for my production builds so I figure'd I drop a PR for it so I don't have to maintain my patched version. |
|
Please god merge this. We're having issues publishing a fix from master branch when dev is ahead. |
|
Also added #511 for durable configuration in |
|
@gigabo thanks!!! |
|
@gigabo Thanks for merging this in! |
|
This works with dependencies between Lerna packages? |
|
@Brantron This just affects the |
|
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This allows for users to opt to use exact versions of cross-dependencies when publishing.