Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I keep flow-typed/npm folder versionated in git?

I'm using flowtypes in my project and getting third-party library definitions via flow-typed CLI.

Running flow-typed install puts in /flow-typed/npm folder all definitions founded for dependencies in package.json.

So I wonder if I should commit this folder or ignore it. Since you may want to add other flowtype definitions to flow-typed folder I'm guessing that /flow-typed/npm folder should be ignored and /flow-typed should be keep in version control but not sure really. Any thoughts?

like image 856
dminones Avatar asked Jan 23 '19 12:01

dminones


People also ask

What is the flow-typed npm package?

The flow-typed npm package provides a CLI that includes several commands for working with this repository. The full list of commands is available in the docs.

Should I commit node_modules to gitignore?

There are pros and cons. I suggest the default is to not commit the node_modules folder, and instead add it to your .gitignore file. You might have special needs that reverse this decision. I discuss the topic so you can make your own opinion.

Should I include node_modules in my Git repository?

9 Answers 9 ActiveOldestVotes 193 The answer is not as easy as Alberto Zaccagni suggests. If you develop applications (especially enterprise applications), including node_modules in your git repo is a viable choice and which alternative you choose depends on your project.

How does Git track changes between versions of a file?

Keep in mind that git isn't tracking differences between versions of any file, but is storing copies of either version of a file as soon as a single character has changed. Every update to any dependency will result in another large changeset.


1 Answers

General advice is to check them into source control: https://github.com/flow-typed/flow-typed/wiki/FAQs#why-do-i-need-to-commit-the-libdefs-that-flow-typed-installs-for-my-project

Libdefs in flow-typed are tagged at both Flow and library version when they are installed, but libdefs themselves can improve over time. For example, they may have a bug or there may be an improvement to their accuracy or completeness.

When a libdef is improved or updated in flow-typed, there's some chance that the change could introduce new Flow errors into your project. As good as it is to find new issues, we also want to make sure that Flow-errors in your project are consistent and predictable over time.

So if/when you wish to upgrade a libdef that you've already checked in to your project's version control, you can do so explicitly with the flow-typed install --overwrite command.

like image 55
TLadd Avatar answered Oct 08 '22 08:10

TLadd