防止解决循环依赖性对本地工作空间

发布于 2025-01-31 01:36:17 字数 307 浏览 3 评论 0原文

我有一个包裹,可以提供基本的公用事业。它在工具上具有DEV依赖性,这有助于构建它。该工具反过来需要包装中的功能。

问题是,在包装的开发过程中,本身的依赖性可以解决到本地工作空间,而不是从注册表中获取它 - 显然是由于两个原因而无法工作的:

  • 不是构建的,
  • 不是构建版本。碰撞了,但是可能已经有个人的变化

,我不知道为什么首先需要这种行为,但是我如何禁用它,迫使注册表的解决方案,从而获取当前最新发布的版本?


将纱线3.2.0与PNP一起使用(看不到3.2.1的任何相关更改,因此恕我直言无关)

I have a package, which offers basic utilities. It has a dev-dependency on a tool, which helps build it. That tool in turn needs features from the package.

The problem is, that during development of the package, the dependency of itself gets resolved to the local workspace, not fetching it from a registry - which obviously won't work, for two reasons:

  • it isn't built
  • the version isn't bumped yet, but there may already be breaking changes

Personally, i don't know why this behavior is desirable in the first place, but how do i disable it, forcing a resolution to the registry, fetching the current latest published version?


Using yarn 3.2.0 with pnp (could not see any related changes towards 3.2.1, therefore imho irrelevant)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

洋洋洒洒 2025-02-07 01:36:17

The behavior can be disabled via enableTransparentWorkspaces: false in yarnrc.yml.


After additional research, i found yarn-2-berry-npm-protocol-switches-to-workspace-resolution, which links to a related github Q&A, where the answer is given. Sadly, it never got accepted on github, nor propagated to the related SO question, so i'll keep this one here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文