我应该在 git 中保留 flow-typed/npm 文件夹版本吗?

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

我在我的项目中使用流类型并通过 flow-typed CLI 获取第三方库定义。

运行 flow-typed install 将所有为 package.json 中的依赖项创建的定义放入 /flow-typed/npm 文件夹中。

所以我想知道我是应该提交这个文件夹还是忽略它。由于您可能想将其他流类型定义添加到流类型文件夹中,我猜测 /flow-typed/npm 文件夹应该被忽略并且 /flow-typed 应该保留在版本控制中但不确定是否真的。有什么想法吗?

一般建议是将它们签入源代码管理: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.