Skip to content

ci: fail on an unmet peer dependency with pnpm peers check - #92

Merged
leemour merged 1 commit into
mainfrom
ci/strict-peer-dependencies
Nov 1, 2026
Merged

leemour merged 1 commit into
mainfrom
ci/strict-peer-dependencies

Conversation

@leemour

@leemour leemour commented Nov 1, 2026

Copy link
Copy Markdown
Member

Task

IDEA-218: a cli-core/cli-base peer-version mismatch passed all local tests and crashed only the packed, npm-installed CLI. Catch it early, in the template.

Why

beeline-cli pinned cli-base 0.63.0 while cli-core wanted >=0.65.0 <0.66.0. pnpm let cli-core use the app's own cli-base, so the dev build and tests worked. npm install of the packed CLI gave cli-core its own cli-base, and the two copies crashed it at start (beeline-cli PR #12).

What

  • .github/workflows/ci.yml: pnpm peers check first in checks. .github/ is in template.json files, so every CLI gets it on its next upgrade.
  • CHANGELOG.md: Unreleased entry.

Not used: strictPeerDependencies: true. Measured on pnpm 11.28.8: it fails a fresh resolve or a local pin bump, but with a lockfile already in place, pnpm install --frozen-lockfile (what CI runs) exits 0 on the same mismatch. It also lives in pnpm-workspace.yaml, a seed that upgrade does not carry.

Scope: the check fails on any unmet peer in the tree, not only cli-base. The template has none today.

Testing

On a scratch copy of the template with cli-base pinned to 0.64.0 (cli-core 0.495.0 wants >=0.65.0 <0.66.0):

  • pnpm install --frozen-lockfile --ignore-scripts → exit 0 (the gap)
  • the first line of the new checks, run as node-ci runs it (bash -eo pipefail -c) → exit 1, ✕ unmet peer @wirecat/cli-base Installed: 0.64.0
  • the same on the unchanged template → exit 0, No peer dependency issues found

🤖 Generated with Claude Code

beeline-cli pinned a cli-base outside cli-core's peer range. pnpm let cli-core use
the app's own cli-base, so every local test passed; npm install of the packed CLI
gave cli-core its own copy, and two cli-base copies crashed it at start.

pnpm peers check reads the lockfile and exits 1 on an unmet peer. It runs first in
ci.yml's checks, which upgrade keeps current in every CLI. strictPeerDependencies
was tried and not used: it fires only when pnpm resolves again, so CI's
--frozen-lockfile install passes a committed mismatch, and pnpm-workspace.yaml is a
seed that upgrade does not carry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit 02023ae into main Nov 1, 2026
13 checks passed
@leemour leemour mentioned this pull request Nov 1, 2026
@leemour
leemour deleted the ci/strict-peer-dependencies branch November 1, 2026 00:44
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.

1 participant