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(bootstrap): preserve indentation style in package-lock.json when running bootstrap #2955
fix(bootstrap): preserve indentation style in package-lock.json when running bootstrap #2955
Conversation
Hi @evocateur, would it be possible to get a review for this? Not sure who I should ping but I'm mentioning you because you're the most recent contributor 🙏 |
Would love to get this reviewed and hopefully merged, thanks for your effort on this one @richardkazuomiller 🤞 it can get merged soon! |
Hi @evocateur - This is still an issue, is there any chance this can be looked at? Thanks! |
Still an issue ++ Running on: |
This is still an issue on |
…running bootstrap
918d5c7
to
ec3c101
Compare
Hi Folks 👋 I had a look at this just now and I am unfortunately struggling to reproduce the issue with the latest lerna and LTS version of Node, NPM 8.
I'm sure I must be missing something so please can somebody help out by heading over to https://github.com/lerna/repro and creating a minimal reproduction? As soon as I can confirm the issue we can look to merge this PR. Many thanks! 🙏 |
Hey @JamesHenry, here is a simple reproduction of the issue: https://github.com/reediculous456/Lerna-Indentation-Test
How I made this example
|
Thanks so much @reediculous456! It was the third party package in the mix I was missing for the repro I think... but regardless I can reproduce the issue, and with a local build using this PR the issue is no longer present. Let's merge! 🚀 |
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.
Thank you for taking the initiative and putting together this PR @richardkazuomiller!
Oh my!! Thank you everyone 🥰 |
Oh cool, after almost a year I almost forgot about this 🤣. Thank you! |
Description
This PR fixes preservation of the indentation style used in
package.json
files by copyingpackage.json
files to their backup location, instead of renaming them. This works because write-pkg will use the same indentation style as thepackage.json
file that it is about to overwrite.Motivation and Context
Running
lerna bootstrap
always converts spaces to tabs inpackage-lock.json
indentations. This happens because Lerna temporarily replaces package.json with a tab-indented file before runningnpm install
. It would be better if Lerna preserved the indentation style, like npm and write-pkg do.Fixes #2845
How Has This Been Tested?
I ran
npm link
with my local copy and tested it in my project by runningnpm link lerna
andlerna bootstrap
. Mypackage-lock.json
files were saved with space indentations, as expected.Types of changes
Checklist: