Skip to content

CI

Changed-only and monorepos

How --changed-only diffs dependencies against the merge-base for zero-noise PR checks, and how --workspaces extends the check across a monorepo.

Changed-only: the PR mode

rn-doctor --changed-only --base origin/main

The problem with running any dependency linter on an existing app is the backlog: a five-year-old project might carry thirty findings, and nobody adopts a check that starts red. --changed-only sidesteps that. It diffs dependencies against the merge-base of HEAD and --base and checks only what the PR actually touched:

  • Added packages — the headline case.
  • Changed specs — upgrades, downgrades, and protocol changes (a switch to a git URL is worth re-checking as much as a version bump).

Everything already on the base branch is ignored, so pre-existing debt never blocks an unrelated PR — adoption is one workflow file, not a cleanup sprint first.

The merge-base semantics match GitHub's three-dot compare: what the PR introduces, not what the base branch gained since branching. If the manifest doesn't exist at the merge-base (a brand-new package), every dependency counts as added.

If the base ref can't be resolved — typically a shallow clone in CI — the error says so and names the fix (git fetch locally, fetch-depth: 0 in Actions).

Workspaces: monorepo mode

rn-doctor --workspaces

Discovers every workspace manifest — pnpm-workspace.yaml takes precedence over the workspaces field in package.json, matching pnpm's own behavior — and checks the root plus every matched package. Findings are grouped per manifest, and annotations point at the right file (packages/app/package.json, line N), not just the repo root.

Each package appearing in multiple manifests is enriched once (one set of network calls), then evaluated per manifest.

Composing both

rn-doctor --changed-only --base origin/main --workspaces

Each workspace manifest is diffed against the same merge-base: a PR adding a dependency to one package in a twenty-package monorepo gets exactly one finding, on the right line of the right file.