Skip to content

Feature Request: angular-style catalogΒ #250

@bgotink

Description

@bgotink

The catalog protocol currently requires listing every package explicitly, and each package is resolved separately.
Certain projects produce multiple packages with aligned version numbers, which are designed to be used with an identical version. An example is Angular, where using @angular/common version 21.2.3 requires that you also use @angular/core at exactly version 21.2.3.

In our org we've created a yarn berry plugin that implements something alike to the catalog protocol but with two changes:

  • Wildcards in selecting the packages (actually regex, but wildcard is good enough)
  • An option for packages to "inherit" the version number from another package
Image

So the feature request is for two things that together would mean we could throw out our plugin:

  • Extend the catalog configuration to support patterns. If a package name is present in multiple patterns, the first match would be used
  • Introduce a new protocol, let's call it copyResolutionFrom for the sake of this feature request. This protocol accepts a descriptor and resolves to the exact same version that that descriptor resolves to.

The angular catalog to replace our custom plugin could look like this:

catalogs:
  angular:
    "@angular/cdk": "npm:^19.0.0-rc"
    "@angular/material": "npm:^19.0.0-rc"
    "@angular/google-maps": "npm:^19.0.0-rc"
    "@angular/cli": "npm:^19.0.0-rc"
    "@angular/build": "copyResolutionFrom:@angular/cli@catalog:angular"
    "@angular-devkit/architect": "npm:>= 0.1900.0-rc < 0.2000.0"
    "@angular-devkit/*": "copyResolutionFrom:@angular/cli@catalog:angular"
    "@schematics/angular": "copyResolutionFrom:@angular/cli@catalog:angular"
    "@angular/core": "npm:^19.0.0-rc"
    "@angular/*": "copyResolutionFrom:@angular/core@catalog:angular"
    "zone.js": "npm:~0.15.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions