fix(deps): move internal-only peer deps to dependencies#10
Merged
Conversation
Three packages were declared as peerDependencies even though they
have NO shared state with the consumer — they're used purely inside
sphere-ui components:
* react-dropzone — implementation detail of <MediaUploader>
* framer-motion — drives motion.* primitives across the lib
* lucide-react — icon set referenced by Icons / form fields
Declaring them as peer forced every consumer to either:
(a) list them explicitly in their own package.json, OR
(b) skip install with --legacy-peer-deps and then have CI fail
because vite can't resolve the imports from sphere-ui/dist.
Moving them to `dependencies` puts them in the install tree
automatically. Consumers don't have to know they exist. npm dedupe
keeps a single copy when consumer-pinned versions overlap, so bundle
size stays the same as before in the common case.
Kept as peer (correctly):
* react / react-dom / @tanstack/react-query / @tanstack/react-table
— single-instance state (hooks, queryClient, table state)
* @dnd-kit/* — DndContext is shared across host + library
* recharts (optional)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three packages were peer dependencies despite having NO shared state with the consumer — they're purely internal to sphere-ui:
As peer deps, every consumer had to either list them explicitly in their own package.json or skip install via `--legacy-peer-deps` and then have CI fail because vite couldn't resolve the imports from `sphere-ui/dist` (which is exactly what just bit backoffice + dev-portal).
Moving them to `dependencies` puts them in the install tree automatically. Consumers don't have to know they exist. npm dedupe keeps a single copy when consumer-pinned versions overlap, so bundle size is unchanged in the common case.
Kept as peer (correctly)
Test plan
🤖 Generated with Claude Code