Git Product home page Git Product logo

Comments (8)

ckarande avatar ckarande commented on August 15, 2024

Hey Andri,

I was not aware of npm shrinkwrap. I just read about it and like the idea. This would ensure consistent builds, without us needing to maintain the modules code.

I would prefer to treat dev dependencies in the same way, so running shrinkwrap with --dev flag. What do you suggest?

from nodegoat.

moll avatar moll commented on August 15, 2024

I have a feeling running it with --dev means development dependencies might get installed on the production machine as well. But if that's not a problem, go ahead.

from nodegoat.

ckarande avatar ckarande commented on August 15, 2024

Good point. One of the reasons I committed modules initially was to have consistent dev environment, especially grunt's version. So I think the little overhead of deploying dev dependencies to prod should be fine.

Would you like to work on this change?

from nodegoat.

jksdua avatar jksdua commented on August 15, 2024

Worth noting, npm install will install the exact copies of modules as specified in the package.json file so there is no need for checking in modules into version control. The benefit of npm install is that it will build the package for the OS architecture. For example, bcrypt will break between Windows, Linux etc.

from nodegoat.

ckarande avatar ckarande commented on August 15, 2024

@jksdua Thanks for the comment. While package.json can control exact versions of packages explicitly specified in package.json, it can't control recursive dependencies of external packages. Shrinkwrap allows us to do that w/o needing to check-in these dependencies. Please feel free to assign this issue to yourself if you want to assist on incorporating shrinkwrap.

from nodegoat.

jksdua avatar jksdua commented on August 15, 2024

@ckarande Sounds good.

I am thinking the following:

  • Add a pre-commit hook which will run npm shrinkwrap when new dependencies are installed. The new npm-shrinkwrap.json will then automatically be added to the commit.
  • Add node_modules to .gitignore

from nodegoat.

ckarande avatar ckarande commented on August 15, 2024

@jksdua Perfect! Thanks. Feel free to send a pull request once ready.

from nodegoat.

ckarande avatar ckarande commented on August 15, 2024

We will not use shrinkwrap, as having npm dependencies added in code makes it easier it deploy on BWA VM instances w/o network connectivity

from nodegoat.

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.