You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to add some sort of auto check to prevent warnings/errors when consuming @chakra-ui/ packages with yarn berry. Some warnings like this during yarn install:
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @chakra-ui/accordion@npm:1.3.0 [140e5] doesn't provide framer-motion (pd5a54), requested by @chakra-ui/transition
➤ YN0002: │ @chakra-ui/skeleton@npm:1.1.11 [140e5] doesn't provide @chakra-ui/theme (p3d7c7), requested by @chakra-ui/media-query
➤ YN0002: │ @chakra-ui/skeleton@npm:1.1.11 [140e5] doesn't provide @emotion/react (pc720b), requested by @chakra-ui/system
➤ YN0002: │ @chakra-ui/skeleton@npm:1.1.11 [140e5] doesn't provide @emotion/styled (pc0ad8), requested by @chakra-ui/system
➤ YN0002: │ @chakra-ui/switch@npm:1.2.4 [140e5] doesn't provide framer-motion (pacb05), requested by @chakra-ui/checkbox
I had a bug report with its fixing PR which are related to this issue. During development of Chakra-UI, some devs add the dependencies but forgot to add its peerDependencies to the list. This is usually fine with npm but yarn berry will complain about it. A possible fix on yarn berry is with the packageExtensions setting (you could read it more in the above link).
Here's what I thought. We could probably:
Setup a GitHub action that runs and warns the user before we publish the new versions
However, that could be challenging because:
The main mono repo is using yarn v1
Thus, adding a package under it which uses yarn v2 seems impossible (need proof!)
I thus took this approach:
Setup an example package under examples-yarn-berry/create-react-app that uses yarn berry in it
During the postinstall script of the top-level project, install that package and see if we've got some error.
I've created a PR and setup an GitHub action on my repo here:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Idea
I want to add some sort of auto check to prevent warnings/errors when consuming
@chakra-ui/
packages with yarn berry. Some warnings like this duringyarn install
:Note: The error code YN0002 is https://yarnpkg.com/advanced/error-codes/#yn0002---missing_peer_dependency
Discussions
I had a bug report with its fixing PR which are related to this issue. During development of Chakra-UI, some devs add the
dependencies
but forgot to add itspeerDependencies
to the list. This is usually fine withnpm
butyarn berry
will complain about it. A possible fix onyarn berry
is with thepackageExtensions
setting (you could read it more in the above link).Here's what I thought. We could probably:
However, that could be challenging because:
I thus took this approach:
examples-yarn-berry/create-react-app
that uses yarn berry in itpostinstall
script of the top-level project, install that package and see if we've got some error.I've created a PR and setup an GitHub action on my repo here:
The command is:
(cd examples-yarn-berry/create-react-app && yarn) | grep 'YN0002' && echo 'Found missing peerDependencies settings' && exit 1
Not sure what you think about this?
Beta Was this translation helpful? Give feedback.
All reactions