Skip to content

fix: make react an optional peer dependency of the CLI#2154

Merged
AndreyHirsa merged 1 commit into
mainfrom
fix/cli-react-optional-peer
Jun 29, 2026
Merged

fix: make react an optional peer dependency of the CLI#2154
AndreyHirsa merged 1 commit into
mainfrom
fix/cli-react-optional-peer

Conversation

@AndreyHirsa

@AndreyHirsa AndreyHirsa commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Make react an optional peer dependency of the lingo.dev CLI so installs no longer force react@19.2.3 and stop breaking repos with strict-peer-deps enabled that use a different React major.

Changes

  • Removed react from lingo.dev (packages/cli) direct dependencies and declared it as an optional peer dependency (react: ">=18 <20", peerDependenciesMeta.react.optional = true).
  • Updated pnpm-lock.yaml to match (one-line specifier change; --frozen-lockfile stays green).
  • Added a patch changeset.

Testing

Business logic tests added:

  • N/A — this is a dependency-manifest change with no runtime code change, so no business-logic tests apply.
  • All tests pass locally

Visuals

N/A

Checklist

  • Changeset added (if version bump needed)
  • Tests cover business logic (not just happy path) — N/A, dependency-manifest change only
  • No breaking changes

Closes N/A

Summary by CodeRabbit

  • Chores
    • Updated package settings so React is now treated as an optional peer dependency.
    • This makes installation more flexible for projects that already provide React, while still supporting compatible React versions.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The react package is removed from the CLI's direct dependencies and re-declared as an optional peer dependency with a version range of >=18 <20. A patch-level changeset is added to document this change for lingo.dev.

Changes

react optional peer dependency

Layer / File(s) Summary
react moved to optional peerDependency
packages/cli/package.json, .changeset/react-optional-peer.md
Removes react@19.2.3 from dependencies, adds peerDependencies with >=18 <20, marks it optional via peerDependenciesMeta, and adds a patch changeset entry.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • cherkanovart

Poem

🐇 A dependency freed from its chain,
Now optional, it need not remain.
Peer it shall be, versions eighteen to twenty,
The CLI stands light, with flexibility plenty.
Hop hop, the changeset is done! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the template with Summary, Changes, Testing, Visuals, and Checklist sections filled out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: the CLI now treats react as an optional peer dependency instead of a direct dependency.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cli-react-optional-peer

Comment @coderabbitai help to get the list of available commands.

@cherkanovart cherkanovart changed the title fix(deps): make react an optional peer dependency of the CLI fix: make react an optional peer dependency of the CLI Jun 29, 2026
@AndreyHirsa AndreyHirsa merged commit 61326c0 into main Jun 29, 2026
16 of 21 checks passed
@AndreyHirsa AndreyHirsa deleted the fix/cli-react-optional-peer branch June 29, 2026 13:25
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.

3 participants