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

1

6

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?

Argo answered 23/1, 2019 at 12:25 Comment(0)
D
10

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.

Danyel answered 25/1, 2019 at 4:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.