Skip to content

chore(deps): move UI libraries from peerDependencies to dependencies - #4

Merged
maherelgamil merged 1 commit into
mainfrom
chore/peers-to-deps
May 28, 2026
Merged

chore(deps): move UI libraries from peerDependencies to dependencies#4
maherelgamil merged 1 commit into
mainfrom
chore/peers-to-deps

Conversation

@maherelgamil

Copy link
Copy Markdown
Contributor

Summary

  • Move every UI library (radix-ui, recharts, sonner, react-day-picker, cmdk, date-fns, lucide-react, class-variance-authority, clsx, tailwind-merge) from peerDependencies into dependencies so they install automatically with npm install monorailphp.
  • Keep react, react-dom, and @inertiajs/react as peers — these must stay a single instance in the host bundle (hooks + Inertia router).
  • Remove a stray monorailphp self-reference from dependencies (leftover from an earlier release).
  • Update docs/getting-started/installation.md to match.

Motivation

Host apps using Monorail currently have to satisfy ~10 peer deps manually (npm 7+ does it for you, but pnpm/yarn with strict peer resolution don't). Most of these libs don't need to dedupe with the host — only React and Inertia do. Promoting them to regular deps removes the friction for new users without harming bundle dedupe in practice (npm/pnpm still dedupes when versions match).

Test plan

  • npm install monorailphp in a clean Laravel + Inertia React app pulls in all UI libraries automatically
  • Existing host apps that already declare these libs continue to dedupe (no duplicated React/Radix)
  • CI release pipeline still publishes successfully

Only react, react-dom, and @inertiajs/react remain as peers — these must
be deduplicated with the host app to avoid breaking hooks and the Inertia
router. Everything else (radix-ui, recharts, sonner, react-day-picker,
cmdk, date-fns, lucide-react, class-variance-authority, clsx,
tailwind-merge) now installs automatically with `npm install monorailphp`,
so host apps no longer need to declare them.

Also drops a stray self-reference to `monorailphp` in `dependencies` that
was a leftover from an earlier release.
@maherelgamil
maherelgamil merged commit de258d5 into main May 28, 2026
9 checks passed
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