Coder Social home page Coder Social logo

Comments (6)

hellofromtonya avatar hellofromtonya commented on May 5, 2024 6

I've not known it to be "the best practice".

And yes, the intent of the lock files is to ensure every developer has the dependencies. However, in practice, it doesn't stack up as the files do change.

Let's take a look at few very popular repos around GitHub to see if they include the lock files.

  • React - no package-lock.json file in the repo
  • Jest - no package-lock.json file in the repo
  • Redux - yes - the package-lock.json file is included
  • Vuejs - no package-lock.json file in the repo
  • Laravel - no composer.lock file in the repo + it's ignored in the .gitignore file
  • Symfony - no composer.lock file is in the repo + it's ignored.

from wprig.

dingo-d avatar dingo-d commented on May 5, 2024 4

Isn't the best practice to keep the lock files in the repositories to ensure every developer has the same dependencies regardless of the local setup?

from wprig.

mor10 avatar mor10 commented on May 5, 2024 4

For the time being I would like to keep the .lock files in place to enforce some level of control. This is consistent with how most projects I've interacted with does things, and as @spencerfinnell pointed out, it is considered best-practice.

I'm closing this issue and the associated PR for now. Let's revisit when WP Rig has made the rounds and we start getting some feedback from the community.

from wprig.

bamadesigner avatar bamadesigner commented on May 5, 2024 1

Here’s the Composer website talking about how you should commit your lock file: https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control

from wprig.

dawsbot avatar dawsbot commented on May 5, 2024 1

@hellofromtonya some of the projects you listed use yarn. Your first example React has a yarn.lock in the root, which is always checked in.

from wprig.

spencerfinnell avatar spencerfinnell commented on May 5, 2024

From https://github.com/npm/npm/blob/latest/doc/files/package-lock.json.md

This file is intended to be committed into source repositories, and serves various purposes:

from wprig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.