-
Notifications
You must be signed in to change notification settings - Fork 10.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
feat(gatsby-cli): Remove one of package-lock.json and yarn.lock on gatsby new #13225
feat(gatsby-cli): Remove one of package-lock.json and yarn.lock on gatsby new #13225
Conversation
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.
Looking great so far @frinyvonnick
Thank you for picking this up! Left a few comments
Thank you for your review @sidharthachatterjee 👍 |
Thank for your review @wardpeet 👍 |
Can't make e2e tests locally even on master last commit I always have the same tests failing. @wardpeet @sidharthachatterjee do you have some pointer to help me getting rid of this ? |
Co-Authored-By: frinyvonnick <frin.yvonnick@gmail.com>
314cfaa
to
c5cbb19
Compare
Thanks for your review @jamo 👍 |
} | ||
conf.set(`package_manager`, response) | ||
if (response.includes(`yarn`)) { | ||
fs.unlinkSync(`package-lock.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.
async removal of files has better support on windows as it retries if it fails on the first try
fs.unlinkSync(`package-lock.json`) | |
await fs.remove(`package-lock.json`) |
https://github.com/jprichardson/node-fs-extra/blob/master/lib/remove/rimraf.js#L45-L51
if (response.includes(`yarn`)) { | ||
fs.unlinkSync(`package-lock.json`) | ||
} else { | ||
fs.unlinkSync(`yarn.lock`) |
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.
see comment above
fs.unlinkSync(`yarn.lock`) | |
await fs.remove(`yarn.lock`) |
This looks great! just a few remarks on fs.unlinksync but after that this is good to 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.
Updated code for my own review so we can get this shipped! Thank you for your hard work!
How would we resolve this issue regarding using the starters, their own repos, and how they might be updated? For example, right now I am trying I see this is being covered on #16135 so I guess I'm just leaving this comment here to help other people out who might be running into this problem. |
Description
I made a first implementation that asks user with prompts which package manager he wants to use.
Related Issues
Related to issue #13210