Skip to content

Add support for exact flag in lerna.json - #661

Merged
evocateur merged 2 commits into
lerna:masterfrom
yasserkaddour:add_exact_flag
Mar 10, 2017
Merged

evocateur merged 2 commits into
lerna:masterfrom
yasserkaddour:add_exact_flag

Conversation

@yasserkaddour

Copy link
Copy Markdown
Contributor

Fixes #511

Comment thread README.md Outdated
"exact": true
}
```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not very sure where I am supposed to add this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already describe the lerna.json "durable" config pattern elsewhere, I think this is implied (much like #598, which only made a single line change and no docs updated).

@evocateur evocateur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache the value outside the forEach loop, and I'd say we're good to go with this. Thanks @yasserkaddour !

Comment thread README.md Outdated
"exact": true
}
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already describe the lerna.json "durable" config pattern elsewhere, I think this is implied (much like #598, which only made a single line change and no docs updated).

Comment thread src/commands/PublishCommand.js Outdated

if (deps[depName] && version) {
deps[depName] = this.flags.exact ? version : "^" + version;
deps[depName] = this.getOptions().exact ? version : ("^" + version);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should cache this getOptions() result outside of the forEach, since it will never change. I appreciate the disambiguating parentheses on the concatenation ternary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅

Comment thread test/PublishCommand.js
});
});

/** =========================================================================

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate test cases, although I think in this case we've already covered the ability for "durable" getOptions() config to bubble up through the various levels (lerna.json vs CLI flags, etc).

I won't say "no" to more tests, though. ^_^

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gigabo said in #426 test would be nice, so I did just that 😄

@evocateur
evocateur merged commit a28be13 into lerna:master Mar 10, 2017
@yasserkaddour
yasserkaddour deleted the add_exact_flag branch March 10, 2017 19:21
@yasserkaddour

Copy link
Copy Markdown
Contributor Author

Thanks for merging

@gigabo

gigabo commented Mar 10, 2017

Copy link
Copy Markdown
Contributor

Thanks @yasserkaddour!

@lock

lock Bot commented Dec 27, 2018

Copy link
Copy Markdown

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.

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants