feat: detect catalog entry changes as package changes#94
Merged
Conversation
When a catalog version in pnpm-workspace.yaml or root package.json (bun/yarn catalog/catalogs, plus workspaces.catalog/catalogs) changes, flag every package that references the changed entry via catalog: / catalog:<name> as changed in `bumpy add` and `bumpy check`. Closes #92
|
The changes in this PR will be included in the next version bump.
|
pnpm/bun treat top-level `catalog` and `catalogs.default` as the same default catalog, with `catalog:` and `catalog:default` both pointing at it. Previously `catalogs.default` was stored under key "default" and `catalog:default` looked up "default", so users who used the alias form got no catalog resolution. Now both forms normalize to the canonical "" key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
pnpm-workspace.yaml(pnpm) or rootpackage.json(bun/yarncatalog/catalogs, plusworkspaces.catalog/workspaces.catalogs) changes between the base branch and HEAD,bumpy addandbumpy checknow flag every package that references the changed entry viacatalog:/catalog:<name>as changed.loadCatalogsto a content-basedparseCatalogsso we can parse catalog state at any git ref. AddeddiffCatalogMaps+isCatalogRefAffectedhelpers.getBaseCompareRef+readFileAtRefgit helpers;getChangedFilesnow usesgetBaseCompareRefto avoid duplication.add.tsinteractive mode now calls the sharedfindChangedPackagesinstead of re-implementing change detection inline (so catalog detection applies there too).Catalog references in any dep section (
dependencies,devDependencies,peerDependencies,optionalDependencies) trigger detection — consistent with how the existing per-file detection treatspackage.jsonchanges uniformly across sections.Closes #92
Test plan
test/utils/package-manager.test.tscoveringparseCatalogs,diffCatalogMaps,isCatalogRefAffected, andresolveCatalogDeptest/core/check-catalog.test.tsusing temp git repos covering: pnpm yaml catalog change, bun-style package.json catalog change, named catalogs, dev/peer dependencies, and a negative case (non-catalog deps not affected)bun run check(tsc) clean