Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
So does to mean that if the consuming project wants to install the dependencies as
The current way of installing those peer dependencies is not how peer dependencies meant to be installed, IMO. At the same time, I do understand that this is more like a workaround/helping features that will cover some (common?) cases, while avoid monkeying user's The documentation didn't get into these details giving the impression that "it will just work". |
Beta Was this translation helpful? Give feedback.
-
Say a package
pkg-a
has thispackage.json
:When installing
pkg-a
,pnpm
yields:i.e.
import 'pkg-b'
will fail.On one hand, this is correct because the project didn't install
pkg-b
directly.But on the other hand, this is wrong because
pkg-b
supposed to be a "peer" ofpkg-a
. That's whatpkg-a
expects thus declaringpkg-b
as a peer dependency instead of a regular dependency.This become an issue when a plugin tells the plugin host to load another plugin.
Examples of plugin host:
vite
,storybook
.Right now, the consuming project needs to install the
peerDependencies
inpkg-a
manually in order for the plugin host (vite
orstorybook
) to load the plugins correctly.i.e., the
auto-peers-install
is not "working".Cross linking the discussion on
storybook
:storybookjs/storybook#29692
Beta Was this translation helpful? Give feedback.
All reactions