ReviewOS

stacks/buddy

Support pnpm catalogs

#117
Closed chris opened this 9 days ago ·
9 days ago

Clear and concise description of the problem

Support pnpm catalogs

Suggested solution

Support pnpm catalogs

Alternative

No response

Additional context

No response

Validations

9 days ago

Status check — still open, and tracked as part of #1385.

Not started. When it is, the shape is: parse pnpm-workspace.yaml catalog: / catalogs: entries, treat catalog: protocol dependencies as resolvable through them, and update catalog entries rather than each dependant. #1385 introduces an EcosystemAdapter interface that this should be written against rather than added to the existing npm path.

9 days ago

Not implemented. #1385 landed the EcosystemAdapter interface (src/ecosystems/types.ts), which is where a pnpm-catalog reader would plug in: detect finds pnpm-workspace.yaml, parse reads the catalog:/catalogs: sections, applyUpdate writes them back preserving formatting. The catalog: protocol in a package.json also needs resolving through the catalog rather than being treated as a version. Tracked as a leftover on #1385.

9 days ago

Landed in bc1a59f.

pnpm-workspace.yaml catalogs are parsed (default and named), catalog: references resolve, and updates land on the workspace file rather than on package.json — in a workspace that uses catalogs the version is the catalog entry, so updating package.json would write the protocol string over itself and change nothing.

The writer is line-based rather than a YAML round-trip, since re-serializing loses the comments and key order a maintainer arranged, and it is scoped to the catalog block an entry belongs to so two catalogs naming the same package at different versions each keep their own. Wrong-current-version guards mean an entry that already moved is not written over.

Wired into scanForUpdates and the write path. 15 tests.

Sign in to comment on this issue.