Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,32 @@ src/

## Peer Dependencies

Required — every entry point needs them:

- `react` ^19.0.0
- `react-dom` ^19.0.0
- `@tanstack/react-query` ^5.0.0
- `@tanstack/react-table` ^8.0.0
- `@dnd-kit/core` ^6.0.0
- `@dnd-kit/sortable` ^8.0.0
- `lucide-react` ^0.400.0

Optional (`peerDependenciesMeta.optional`) — only some entry points need them:

- `@tanstack/react-table` ^8.0.0 — root barrel only (`DataTable`)
- `@dnd-kit/core` ^6.0.0 — root barrel and `./hooks` only
- `@dnd-kit/sortable` ^8.0.0 || ^10.0.0 — root barrel and `./hooks` only
- `@dnd-kit/utilities` ^3.0.0 — root barrel only (`MediaGallery`)
- `recharts` ^3.0.0 — `./analytics` only
- `@tanstack/react-query` ^5.0.0 — no entry point imports it today; kept as a
version hint for apps that pair it with these components

**Do not make these required again.** npm 7+ auto-installs non-optional peers,
so a non-optional entry here forces every consumer's lockfile to contain it,
even one that imports a narrow subpath like `./announcements` (react +
lucide-react + react-markdown + remark-gfm and nothing else). Consumers whose
lockfile was generated with `legacy-peer-deps=true` then fail `npm ci` in CI
with "Missing: <pkg> from lock file". Marking them optional lets each app
declare only what it actually uses; the root-barrel consumers (`sphere`,
`sphere-dev-portal`, `sphere-backoffice`) already list all of them as their own
direct dependencies, so nothing changes for them.

`lucide-react` is a regular dependency, not a peer.

## License

Expand Down
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@
"recharts": "^3.0.0"
},
"peerDependenciesMeta": {
"@dnd-kit/core": {
"optional": true
},
"@dnd-kit/sortable": {
"optional": true
},
"@dnd-kit/utilities": {
"optional": true
},
"@tanstack/react-query": {
"optional": true
},
"@tanstack/react-table": {
"optional": true
},
"recharts": {
"optional": true
}
Expand Down
Loading