bootstrap-genesis icon indicating copy to clipboard operation
bootstrap-genesis copied to clipboard

Decide how we want to handle package-lock.json (and yarn.lock)

Open salcode opened this issue 7 years ago • 4 comments

We should either add this file to .gitignore because all of our dependencies are part of our build process and we want the latest version and if it breaks it is not catastrophic OR we should check this file in (which should be its own commit).

To complicate things, I've started using yarn rather than npm, which generates yarn.lock instead.

It seems kind of heavy to have two different lock files included, so I guess I'm leaning towards adding both of these files to .gitignore (but I'm open to other opinions).

salcode avatar Feb 20 '18 21:02 salcode

I have done a quick read of the docs for both yarn.lock and package-lock.json and they both suggest that they should be under source control.

However, in the case of cloning the repo and downloading the packages you can use npm install --no-package-lock or yarn install --no-lockfile.

This says to me, drop it in the .gitignore, like you say it's part of the build process of the theme and you want the latest version.

atcraigwatson avatar Feb 21 '18 12:02 atcraigwatson

Thanks for doing the leg work on reading those docs.

This says to me, drop it in the .gitignore, like you say it's part of the build process of the theme and you want the latest version.

Cool, let's plan to add them both to .gitignore

salcode avatar Feb 21 '18 15:02 salcode

I've updated the title of this issue, now that we have a game plan.

salcode avatar Feb 21 '18 15:02 salcode

@salcode

This could be something to consider if there is a way to do this for yarn as well.

https://www.codementor.io/johnkennedy/get-rid-of-that-npm-package-lock-json-e0bj7ai42

atcraigwatson avatar Feb 21 '18 20:02 atcraigwatson