You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really liking lerna so far. However I've encountered some unexpected behavior that wound up getting pushed to our public repo and published to npm.
I'd like to be able to run lerna publish to the point of creating the version commit and tag and stop it there so I can inspect what it did before proceeding.
My first thought for an interface for this is:
$ lerna prepublish
... make sure everything's as expected...$ lerna publish
Where in this case lerna publish would see that the head revision is a version tag and skip the prepublish steps.
It might also be nice to have a lerna revert that's basically just git reset --hard HEAD^ after verifying that the HEAD revision is a version commit.
I'd be happy to do the work for this and submit a PR if you're open to the idea. How does it sound? Ideas for a better interface?
Thanks!
Bo
Reacted by azu, Khau Ho, Aaron Lampros, Shawn Allen, Jan Molak, Pavlo Michal, Tamlyn Rhodes, Ahmad Awais, Vaughan Rouesnel, Alexander Kachkaev and 109 more
I'd rather just the --dry-run flag that give you a detailed run through of what it would do. This requires abstracting away operations that have side-effects into utilities that can be turned off via a flag, which I already wanted to do for logging (#49), I'll take this over because it will require abstraction of a lot of things.
Reacted by Stephen Sorensen, David Chase, Vaughan Rouesnel, Andrew Stalick, Andrew Lisowski, Robbie Bardijn, Merwan Rodriguez, Steven, Danny Brown, Alasdair and 17 more
Any update on the progress here? @thejameskyle Noticed some verbose logging has been merged just wondering if this flag will be following soon?
As someone picking up lerna for the first time this would be an incredibly useful feature just for getting to grips and not worrying about blowing things up! :)
It's a tough problem because some things depend on file system state. We need to do more work to read the entire file system that it cares about at the beginning and track it throughout the entire process. This will also help performance because there are places where we are re-reading files we already have in memory.
Having a --dry-run flag would still be very helpful!
Reacted by David-A Wragg, Marcin Krawczyk, Wired Earp, César Jeanroy, Adam Elders, Mircea Nistor, Dennis Hellwig, Davit Yavryan, Adam ElKhayyat, Juan Monterrosa and 1 more
Seen that nobody really submitted a PR for this so I thought I'd give it a try (#3401).
If you think we can do it better, I'm open to any other suggestions, hope I have some time to add them 🤕
These changes seem to solve at least my use case (want to get a preview of the versions to be created in a CI pipeline - no user inputs allowed, and have someone manually approve that they're correct)
Reach out if you find anything 🤓
Reacted by James O'Brien, escapedcat, Alexander Slavschik, Faisal Rahman and Yordan Kanchelov
Any updates on this?
I've seen the PR #3401 was declined because it's being worked on, but there hasn't been an update since then.
I'd like to have something to programmatically get the "next versions" of packages being published (and maybe an error if there are none)
Reacted by Dennis Hellwig, Shabab Qaisar, Noï van Mondfrans, Rafael Leite, Yordan Borisov, Gabriel Nastase, Landon Gavin, Andrii Oriekhov, Chris Atwood and Naomi
It updates the versions in package.json files in the packages but since I run this command on a CI job I don't need to do anything about them as the changes will be discarded.
If you are willing to use this command until there is an official one I suggest you to check what does each config flags mean and adjust them according to your needs
The reason that the above command is not the same as --dry-run is because there is no way to be certain that you've copy/pasted what would be the same thing. --dry-run should do everything short of publishing to npm/pushing to git remotes, in order to test that you've configured CI correctly. Otherwise you're building the plane as you fly it.
--dry-run is bog standard in any destructive tool. Perhaps this should be closed with "Won't Fix" if that's the true intent?
Reacted by Bertrand Caron (Cascade), Konstantin Burkalev and Jimmy Multani
Thanks to open-source, just head over to lerna-lite.
--dry-run
Displays the git command that would be performed without actually executing it, however please note that it will still create all the changelogs. This could be helpful for troubleshooting and also to see changelog changes without committing them to Git.
Activity
sebmck commentedon Feb 12, 2016
Sounds like you're looking for just
lerna updatedthen?gigabo commentedon Feb 12, 2016
I don't think
lerna updatedactually gives me what I want here.Here's the output:
What I'm looking for is: What exact changes will
lernamake before publishing.I just want the opportunity to review the commit before it's pushed and published in my name. :)
jamiebuilds commentedon Feb 12, 2016
Oh like a
--dry-runflaggigabo commentedon Feb 12, 2016
Yes, exactly! Though the partial work done during the dry run in general will be just fine and I wouldn't want to do it again for the actual publish.
gigabo commentedon Feb 12, 2016
So what about this for an interface:
hzoo commentedon Feb 12, 2016
Yeah ok, so you don't publish what you didn't intend?
gigabo commentedon Feb 12, 2016
Exactly! If that interface looks okay I'd be happy to set it up and submit a PR.
jamiebuilds commentedon Feb 12, 2016
I'd rather just the
--dry-runflag that give you a detailed run through of what it would do. This requires abstracting away operations that have side-effects into utilities that can be turned off via a flag, which I already wanted to do for logging (#49), I'll take this over because it will require abstraction of a lot of things.gigabo commentedon Feb 12, 2016
Sounds good. Thanks @thejameskyle.
[-]Feature request: lerna prepublish[/-][+]Feature request: lerna --dryrun[/+]chrisui commentedon Apr 14, 2016
Any update on the progress here? @thejameskyle Noticed some verbose logging has been merged just wondering if this flag will be following soon?
As someone picking up lerna for the first time this would be an incredibly useful feature just for getting to grips and not worrying about blowing things up! :)
jamiebuilds commentedon Apr 14, 2016
It's a tough problem because some things depend on file system state. We need to do more work to read the entire file system that it cares about at the beginning and track it throughout the entire process. This will also help performance because there are places where we are re-reading files we already have in memory.
chrisui commentedon Apr 14, 2016
@thejameskyle Cheers for the update!
I wonder if a proxy around node
fsand https://github.com/webpack/memory-fs would do the trick for you?[-]Feature request: lerna --dryrun[/-][+][Feature] lerna --dryrun[/+]36 remaining items
fsmaia commentedon Oct 14, 2022
Having a
--dry-runflag would still be very helpful!meteabduraman commentedon Oct 30, 2022
Hey,
Seen that nobody really submitted a PR for this so I thought I'd give it a try (#3401).
If you think we can do it better, I'm open to any other suggestions, hope I have some time to add them 🤕
These changes seem to solve at least my use case (want to get a preview of the versions to be created in a CI pipeline - no user inputs allowed, and have someone manually approve that they're correct)
Reach out if you find anything 🤓
ChFlick commentedon Apr 5, 2023
Any updates on this?
I've seen the PR #3401 was declined because it's being worked on, but there hasn't been an update since then.
I'd like to have something to programmatically get the "next versions" of packages being published (and maybe an error if there are none)
sqaisar commentedon Apr 27, 2023
+1 for the feature. I've some other files like helm chart that needs the updated version/tag to be added to that file.
next-juanantoniogomez commentedon Jan 29, 2024
+1 for the feature
sevilyilmaz commentedon May 13, 2024
I run
lerna versionon a Gitlab CI job with some config options and log the upcoming versions in a merge request for that MR's changes.The command below basically tries to mimic a version command without pushing anything to a registry or a repo.
npx lerna version --no-private --yes --exact --conventional-commits --no-git-tag-version --no-push --no-changelog --json --allow-branch ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}It updates the versions in
package.jsonfiles in the packages but since I run this command on a CI job I don't need to do anything about them as the changes will be discarded.If you are willing to use this command until there is an official one I suggest you to check what does each config flags mean and adjust them according to your needs
cellog commentedon May 28, 2024
The reason that the above command is not the same as
--dry-runis because there is no way to be certain that you've copy/pasted what would be the same thing.--dry-runshould do everything short of publishing to npm/pushing to git remotes, in order to test that you've configured CI correctly. Otherwise you're building the plane as you fly it.--dry-runis bog standard in any destructive tool. Perhaps this should be closed with "Won't Fix" if that's the true intent?SchulteDev commentedon Aug 16, 2024
Thanks to open-source, just head over to lerna-lite.
lerna-lite --dry-run
zifeiyu666 commentedon Sep 13, 2024
did lerna now have the support of --dry-run when publish ?
build: replace lerna with lerna-lite
ashwinkumar6 commentedon Feb 24, 2025
Is the
--dry-runfeature out yet ?nikzanda commentedon Mar 26, 2026
is there any news on this feature?