[英]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.