Skip to content
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

Don't list lockfiles in .gitignore, remove them before commits #518

Closed
wants to merge 2 commits into from
Closed

Don't list lockfiles in .gitignore, remove them before commits #518

wants to merge 2 commits into from

Conversation

luftywiranda13
Copy link

What:
Integrate remove-lockfiles

Why:
Currently this project ignores lockfiles (package-lock.json & yarn.lock). This can lead to harder debugging process because contributors might be locked to different versions of deps

How:

  • Install remove-lockfiles then integrate it in precommit
  • Remove lockfiles from .gitignore

How did I test this?

  • There are tests in remove-lockfiles repo
  • Also tested in this project by installing deps using yarn and npm. Lockfiles were generated but not included in commits.
  • remove-lockfiles not only unstages but also removes the lockfiles before commits

@silverwind
Copy link
Member

Hmm, I'd rather avoid having them created in the first place than to introduce a git hook. I have to investigate if adding a .npmrc and a .yarnrc in the project directory can effectively prevent their creation.

@luftywiranda13
Copy link
Author

luftywiranda13 commented Aug 10, 2017

@silverwind yes, it can. but the downside is it means you limit the contributors to use a specific package manager only (npm or yarn).

how about having both of the dotfiles (.yarnrc and .npmrc) together?
hmmm I don't think it's a good idea. two additional dotfiles just to prevent the lockfiles 😢

@silverwind
Copy link
Member

Yes, it's a shame. I'd really like a option in package.json to disable lockfiles which all package managers should honor.

@luftywiranda13
Copy link
Author

I agree, wish there's a universal option that we can add in package.json to prevent lockfiles creation. But I think we're still far from that because both (npm and yarn) suggest to commit the lockfiles for both libraries and apps

@silverwind
Copy link
Member

I opted for the config file approach, thought I don't really think the issue will matter. We don't get many contributors and most of them probably never install dependencies.

@silverwind silverwind closed this Aug 10, 2017
@luftywiranda13
Copy link
Author

well yeah it's okay, thanks anyway 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants