-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: skip-temp-tag #620
Conversation
In response to #293 |
src/commands/PublishCommand.js
Outdated
}); | ||
if (skipTempTag) { | ||
this.progressBar.tick(pkg.name); | ||
this.execScript(pkg, "postpublish"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the actual publish happening with --skip-temp-tag
?
So the idea is that
If we did not ignore temp tagging then:
|
I also introduced the |
@@ -394,6 +397,7 @@ export default class PublishCommand extends Command { | |||
} | |||
|
|||
npmUpdateAsLatest(callback) { | |||
const {skipTempTag} = this.getOptions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we've skipped temp-tagging, why not just avoid the runParallelBatches
call entirely?
const {skipTempTag} = this.getOptions();
if (skipTempTag) {
return callback();
}
this.progressBar.init(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I missed that. Corrected in 0c6ac7e
src/commands/PublishCommand.js
Outdated
|
||
getDistTag() { | ||
const {npmTag, canary} = this.getOptions(); | ||
return npmTag ? npmTag : canary ? "canary" : "latest"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really dislike nested ternaries, especially all on one line. Wouldn't boolean defaults work here?
return npmTag || (canary && "canary") || "latest";
src/commands/PublishCommand.js
Outdated
@@ -349,6 +349,9 @@ export default class PublishCommand extends Command { | |||
} | |||
|
|||
npmPublishAsPrerelease(callback) { | |||
const {skipTempTag} = this.getOptions(); | |||
// if we skip temp tags we should tag with the proper value immediately therefore no updates will be needed | |||
const tag = !skipTempTag ? "lerna-temp" : this.getDistTag(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's invert the ternary (const tag = skipTempTag ? this.getDistTag() : "lerna-temp";
) and make sure there's a newline between this assignment and the next forEach
block.
LGTM, thanks for your responsiveness @noherczeg! If @gigabo has no objections, I will merge this tomorrow. |
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. |
I have no idea if this is a proper solution, therefore I'd like to have some guidance on how to properly test this.