简体   繁体   English

更新私有nodejs包树的最佳(更容易/更快)方法是什么

[英]What is best (easier / faster) approach to update private nodejs packages tree

Recently I started to use a private npm packages for backend.最近我开始使用私有 npm 包作为后端。 They stored on our private packages server (an npm repository I deployed among application components.它们存储在我们的私有包服务器上(我在应用程序组件中部署的一个 npm 存储库。

And while I mostly like how it all works and happens, but there is a gotcha.虽然我最喜欢这一切是如何运作和发生的,但有一个问题。 Imagine a packages like: @example/logging , @example/utilities , @example/validation , @example/database , @example/security - low-level packages.想象一个包,如: @example/logging@example/utilities@example/validation@example/database@example/security - 低级包。 And many of these low-level packages depends on @selfcad/logging package.许多这些低级软件包依赖于@selfcad/logging package。 @example/updates-queue , @example/subscriptions , @example/auth-tools , @example/cloud-functions and @example/backend-core packages are representing high-level abstractions and components. @example/updates-queue@example/subscriptions@example/auth-tools@example/cloud-functions@example/backend-core包代表高级抽象和组件。 Each of high-level packages depending on few or sometimes all of low-level packages.每个高级包都依赖于少数或有时全部的低级包。 Some of these packages are referenced in cloud functions via @example/cloud-functions package, especially low-level packages.其中一些包通过@example/cloud-functions package 在云函数中引用,尤其是低级包。 Other used directly in a cloud functions.其他直接在云端使用的功能。 Plus there is a backend component where most of packages are used directly.此外,还有一个后端组件,大多数包都直接使用。

So, true headache starts, when a change must be made eg in the low-level package like @example/logging or @example/validation .因此,真正的头痛开始了,当必须进行更改时,例如在低级 package 中,如@example/logging@example/validation

And what is the most easier way to spread the update or fix to widely referenced lower package?将更新或修复传播到广泛引用的较低 package 的最简单方法是什么? With nested dependencies.具有嵌套依赖项。 Like so: a package, eg @example/validation referenced directly and indirectly , like @example/configuration uses @example/validation , @example/database uses @example/validation and I updated @example/validation internals.像这样:package,例如直接间接引用的@example/validation ,例如@example/configuration使用@example/validation@example/database使用@example/validation ,我更新了@example/validation内部。 How to spread such update across packages?如何跨包传播这样的更新?

Maybe you should have a look to Yarn Workspaces .也许你应该看看Yarn Workspaces This is a useful feature of yarn to link dependent packages each others using a mono repo.这是 yarn 的一个有用功能,可以使用 mono 存储库将依赖包相互链接。 This feature also includes auto-discovery/auto-linking.此功能还包括自动发现/自动链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在NodeJS中将对象传递给子文件的最佳方法是什么? - What is the best approach to pass objects to subfiles in NodeJS? 在NodeJS和MySQL中为标记系统进行3表更新的最佳方法 - Best Approach to a 3 Table Update for Tagging System in NodeJS and MySQL 在NodeJ中合并真正大列表的最佳方法是什么? - What is the best approach to merge a list of really big lists in NodeJs? 使用 NodeJS、Postgres 显示摘要数据的最佳方法是什么? - What is the best approach to display the summary data using NodeJS, Postgres? 在nodejs中切换本地文件系统和Amazon S3文件系统的最佳方法是什么? - What is the best approach in nodejs to switch between the local filesystem and Amazon S3 filesystem? NodeJs,猫鼬:更新前检查auth的最佳方法是什么? - NodeJs, Mongoose: what's the best way to check auth before update? 在Express Node.js MongoDB中审核帖子的最佳方法 - Best approach to moderate posts in express nodejs mongodb 密码加密的最佳方法是什么 - What is the best approach for password encryption 保护 JWT 的最佳方法是什么? - What is the best approach to secure JWTs? NodeJS-处理私人消息传递的最佳方法? - NodeJS - Best way to handle private messaging?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM