-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(version): Prioritize --preid
over existing prerelease ID
#1568
Conversation
in order to switch from alpha version to rc for exemple change condition to take first preid insteed of existing preid
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.
This change looks reasonable, but it needs a test. Copy this test, and pass "--preid", "rc"
after the "prerelease"
argument to lernaVersion()
, then validate that the changes are as expected.
Thanks for the review, I add the test as you asked me. |
3282dff
to
317a1ca
Compare
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.
None of the snapshots need updating, as you're not even adding a new snapshot. The lockfile should also not be changed (you're not adding or removing dependencies)
package-lock.json
Outdated
"version": "1.3.3", | ||
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.3.tgz", | ||
"integrity": "sha512-3Sp6WZZ/lXl+nTDoGpGWHEpTnnC6X5fnkolYZR6nwIfzbxxvA8utPWe1gCt7i0m9uVGsSz2IS8K8mJ7HmlduMg==", | ||
"version": "1.3.4", |
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.
The lockfile should not have changed (npm ci
should be sufficient). Please revert this file
--- a/packages/package-1/package.json | ||
+++ b/packages/package-1/package.json | ||
--- c/packages/package-1/package.json | ||
+++ w/packages/package-1/package.json |
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'm not sure why these snapshots needed to be updated. Are you using a non-English localization of git?
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'm on an english localization of git, just my OSX is in French. I revert my package-lock, ran npm ci
the only diff is the new test. I have the same problems with snapshots on my computer, but it pass on CI 👍
revert package-lock file
5384039
to
c9f12ec
Compare
Okay, well, I can assure you the snapshots do not need updating, and the CI build should pass once you revert the snapshot updates. We probably have to pass some flags to git or something, I don't know why it is trying to change the diff prefixes, it's completely unrelated to your change.
… On Aug 14, 2018, at 21:38, Moïse FISCAL ***@***.***> wrote:
@moe971 commented on this pull request.
In commands/diff/__tests__/__snapshots__/diff-command.test.js.snap:
> index SHA..SHA 100644
---- a/packages/package-1/package.json
-+++ b/packages/package-1/package.json
+--- c/packages/package-1/package.json
++++ w/packages/package-1/package.json
I'm on an english localization of git, just my OSX is in French. I revert my package-lock, ran npm ci the only diff is the new test. I have the same problems with snapshots.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
As you said after revert everything is green on CI, thanks for your help. |
--preid
over existing prerelease ID
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.
Looks great, thanks!
I don't think this solves #1214, as it's actually a separate code path (but certainly accesses similar properties). |
I think passing an explicit |
I sync my repo, |
Unless you're making changes to dependencies, I would run `npm ci` instead of `npm i`. All the lint errors are due to a bad node_modules state.
… On Aug 15, 2018, at 23:27, Moïse FISCAL ***@***.***> wrote:
I sync my repo,
My current commit match with 3.0.6 tag, I run npm i && npm run ci I've got 526 lint error for import/unresolved, did I miss something ?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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. |
in order to switch a prerelease id from alpha version to rc I needed to change condition to prioritize preid insteed of an existing preid
Description
I juste change order of OR statement to take first preid
const resolvePrereleaseId = existingPreid => preid || (isPrerelease && existingPreid) || "alpha";
Motivation and Context
On my continuous integration workflow version my app on alpha prerelease, then on it goes to release candidate, so I try tu use lerna version prerelease --preid rc but because my previous tag was dam/library-client@0.1.1-alpha.10 lerna 3.0.4 used my existing preid.
The solution was to change order on the test statement.
How Has This Been Tested?
It has been test on my project, it works 👍
Types of changes
Checklist: