Skip to content

Conversation

@parksb
Copy link
Member

@parksb parksb commented Sep 30, 2025

This PR implements a new catalog management system using catalogs.yml with hierarchical inheritance support.

The yarn catalogs apply command reads catalog definitions from catalogs.yml, resolves all inheritance, and writes them to .yarnrc.yml. A --dry-run flag allows previewing changes. The plugin options (default, validation, ignoredWorkspaces) are now read from the options field in catalogs.yml instead of .yarnrc.yml.

This PR removes custom catalog resolution logic and delegates it to Yarn's native Catalogs support (available since 4.10.0), while preserving the plugin's extended options features. The plugin no longer implements core catalog resolution hooks (reduceDependency, beforeWorkspacePacking).

catalogs.yml:

options:
  default: [stable/canary]
  validation: warn

list:
  root:
    lodash: npm:4.17.21

  stable:
    react: npm:18.0.0
    typescript: npm:5.1.0

  stable/canary:
    react: npm:18.2.0      # Overrides stable
    # typescript: npm:5.1.0  (inherited from stable)

  stable/canary/next:
    react: npm:18.3.0      # Overrides stable/canary
    # typescript: npm:5.1.0  (inherited from stable)

Apply to .yarnrc.yml:

$ yarn catalogs apply
✓ Applied 1 root catalog and 3 named catalog groups to .yarnrc.yml

After applying, .yarnrc.yml contains:

catalog:
  lodash: npm:4.17.21

catalogs:
  stable:
    react: npm:18.0.0
    typescript: npm:5.1.0

  stable/canary:
    react: npm:18.2.0
    typescript: npm:5.1.0 # Inherited and resolved

  stable/canary/next:
    react: npm:18.3.0
    typescript: npm:5.1.0 # Inherited and resolved

@parksb parksb self-assigned this Sep 30, 2025
@parksb parksb force-pushed the feat/about-the-future branch from 4665727 to 7e33539 Compare September 30, 2025 10:55
@parksb parksb force-pushed the feat/about-the-future branch from 9136bf1 to 22753b2 Compare October 1, 2025 13:24
@parksb parksb force-pushed the feat/about-the-future branch from 22753b2 to 583a94b Compare October 1, 2025 13:28
@parksb
Copy link
Member Author

parksb commented Nov 11, 2025

Moved to #31

@parksb parksb closed this Nov 11, 2025
@parksb parksb deleted the feat/about-the-future branch November 11, 2025 04:01
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.

2 participants