Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing peer dependencies #133

Merged
merged 2 commits into from
Jun 14, 2022
Merged

Add missing peer dependencies #133

merged 2 commits into from
Jun 14, 2022

Conversation

asmundg
Copy link
Contributor

@asmundg asmundg commented Dec 30, 2021

We require these at runtime, so they need to at least be
peerDependencies (if not normal dependencies).

Packagers such as Yarn PnP and pnpm use an unambiguous dependency
layout, where packages are only able to require their declared
dependencies. In order to consume dependencies fulfilled by our
ancestors in these scenarios, we have to declare them as
peerDependencies. This will cause the package manager to "forward"
matching dependencies declared by our parent.

We require these at runtime, so they need to at least be
peerDependencies (if not normal dependencies).

Packagers such as Yarn PnP and pnpm use an unambiguous dependency
layout, where packages are only able to require their declared
dependencies. In order to consume dependencies fulfilled by our
ancestors in these scenarios, we have to declare them as
peerDependencies. This will cause the package manager to "forward"
matching dependencies declared by our parent.
@pocka
Copy link
Collaborator

pocka commented Dec 31, 2021

@asmundg
I removed the peer deps once because AFAIK package user needs to install packages listed in peerDependencies on their project to suppress npm warning messages. Do Yarn PnP and pnpm support peer deps outside a dependency tree? (I'm willing to add these as direct dependencies if needed.)

[end user package]
+-- @storybook/react
|   +-- @storybook/api (can `storybook-addon-designs` use this package?)
|   +-- ...
|
+-- storybook-addon-designs

@pocka
Copy link
Collaborator

pocka commented Jun 14, 2022

I'm still not sure what is the most idiomatic way to declare indirect dependencies, but I'm going to merge this since it seems using peerDependencies is the recommended way.

@pocka pocka added the category: bug Something isn't working label Jun 14, 2022
@pocka pocka merged commit b56fac6 into storybookjs:master Jun 14, 2022
@pocka pocka changed the title fix: Add missing peer dependencies Add missing peer dependencies Jun 14, 2022
@pocka pocka added this to the v7.0 milestone Jun 14, 2022
@pocka
Copy link
Collaborator

pocka commented Jun 16, 2022

Fixed in v7.0.0-alpha.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants