You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: detect catalog entry changes as package changes (#94)
## Summary
- When a catalog entry in `pnpm-workspace.yaml` (pnpm) or root
`package.json` (bun/yarn `catalog`/`catalogs`, plus
`workspaces.catalog`/`workspaces.catalogs`) changes between the base
branch and HEAD, `bumpy add` and `bumpy check` now flag every package
that references the changed entry via `catalog:` / `catalog:<name>` as
changed.
- Refactored `loadCatalogs` to a content-based `parseCatalogs` so we can
parse catalog state at any git ref. Added `diffCatalogMaps` +
`isCatalogRefAffected` helpers.
- Added `getBaseCompareRef` + `readFileAtRef` git helpers;
`getChangedFiles` now uses `getBaseCompareRef` to avoid duplication.
- `add.ts` interactive mode now calls the shared `findChangedPackages`
instead 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 treats
`package.json` changes uniformly across sections.
Closes#92
## Test plan
- [x] 18 new unit tests in `test/utils/package-manager.test.ts` covering
`parseCatalogs`, `diffCatalogMaps`, `isCatalogRefAffected`, and
`resolveCatalogDep`
- [x] 5 new integration tests in `test/core/check-catalog.test.ts` using
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)
- [x] All 253 existing tests still pass
- [x] `bun run check` (tsc) clean
Detect catalog entry changes as package changes. When a catalog version in `pnpm-workspace.yaml` (pnpm) or root `package.json` (bun/yarn `catalog`/`catalogs`, plus `workspaces.catalog`/`workspaces.catalogs`) is modified, `bumpy add` and `bumpy check` now flag every package that references the changed entry via `catalog:` / `catalog:<name>` as changed. Closes #92.
0 commit comments