node.js - 如何自动化 NodeJS/npm 依赖更新?
问题描述
我正在维护一些大型 NodeJS 应用程序(微服务、应用程序),它们消耗许多(至少 100 多个)依赖项。更新这些依赖项以修复安全漏洞迫使我花费宝贵的开发时间。
有没有办法跨存储库自动更新包?
We're using GitLab for SCM.
我曾想过一些选择,例如:
Separating out core dependencies into a base level library
.Maintain a repository that specifies security-cleared dependency versions and repositories to be updated whenever the cleared list changes.
任何其他建议/示例?
解决方案
只是为了帮助列出问题中提到的入围方法:
1. Separating core dependencies into a "Core" library.
- 这可以减少更新次数。但是基于“Core”的库仍然有自己的依赖,可能容易出现漏洞,必须手动重复更新周期。这种方法只会拖延手动更新。
2. Maintain a repository that specifies security-cleared dependency versions and repositories to be updated whenever the cleared list changes.
- 这里有几个选项:
- 关于通过管道脚本自动化的
文章
- GitHub:使用next-update + Hub CLI
- GitLab:使用next-update + Lab CLI
- 实现dependabot-core(GitHub)或dependabot-gitlab(GitLab)
- 实施整治。
- 关于通过管道脚本自动化的
文章
推荐阅读
- javascript - 无法在选择输入类型的下拉列表中设置可见选项的限制
- sql - 以 YYYY-MM-DD 格式计算 min() 日期和 max() 之间的时间并转换为月份
- javascript - 如何在 Three.js 中的小网格上正确渲染大纹理?
- python - 无法再在 MacOS Catalina 上的 BBEdit 虚拟环境中访问调试器
- python - 如何将_xticklabels 设置为pandas DataFrame 的相应“日期”列?
- r - 创建一个循环以从多个栅格中提取数据
- c++ - 在列中打印数字时如何避免打印垃圾?
- java - Ebean 中持续存在多级级联
- java - 如何在Java中修复对象不移出框架?
- r - 计算 2(为 2 定义一个函数,其中模型是一条线)