Skip to content

Conversation

@WooWan
Copy link
Contributor

@WooWan WooWan commented Sep 27, 2025

What's the problem this PR addresses?

Fixes: #6925

Adds support for catalog: protocol in peerDependencies. Previously, catalog references in peer dependencies were incorrectly reported. This change allows catalog references to be used in peer
dependencies, consistent with their support in other dependency types.

...

How did you fix it?

Updated the dependency range validation logic in Manifest.ts to treat catalog: protocol as a valid range format. This prevents catalog references from being
flagged as errors when used in peer dependencies.

...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@MKruschke
Copy link

Hi,
any update on this one would be nice to use also catalog references inside the peerDeps. 🙏🏻

@arcanis
Copy link
Member

arcanis commented Nov 7, 2025

I'm not certain that's correct - afaik the reduceDependency hook we use to apply catalog updates doesn't iterate over peerDependencies, so we'd always keep the catalog: range in the peerDependencies field rather than replacing it.

@WooWan
Copy link
Contributor Author

WooWan commented Nov 7, 2025

I'm not certain that's correct - afaik the reduceDependency hook we use to apply catalog updates doesn't iterate over peerDependencies, so we'd always keep the catalog: range in the peerDependencies field rather than replacing it.

I'm not very familiar with reduceDependency, do you think the fundamental solution would be to fix reduceDependency so that it iterates over peerDependencies as well?

@arcanis
Copy link
Member

arcanis commented Nov 7, 2025

That would be a breaking change, as 3rd-party plugins would have their behavior changed in hard-to-predict ways.

Probably the safest is to introduce a reducePeerDependency hook here and here. I'm a little worried about the potential perf impact but it's worth a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: Yarn Catalog does not support peerDependencies

3 participants