-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
'yarn start-storybook' creates node_modules/.cache in Yarn 2 PnP project #11113
Comments
@gaetanmaisse WDYT? |
I forgot to mention that I am on 6.0.0-beta.21 |
I updated the path of the cache directory when I worked on Yarn 2 compatibility as it was previously: When I did this change I looked for a "classic/conventional" way to handle cache but unfortunately, I didn't find any great things. So I discussed a bit with some other maintainers and we decided to go with
I also asked a Yarn maintainer if he was aware of other projects with the same issue/question. Good news we are not alone 😃 but there isn't any convention for now 😞. However, @arcanis (🧶 Yarn main maintainer) has found in this "issue" a potential opportunity to create an official Yarn package for cache management, details are here: yarnpkg/berry#918. Having such a package would be great both for Storybook and the whole JS ecosystem, so lets 🤞😃 Did you face any issue with the current behavior? or were you just surprised to have |
Yep, Note that Yarn 2 intentionally doesn't remove dot-folders from the |
You are right, everything works but I was surprised to find |
@gaetanmaisse @arcanis just want to say you guys rock! it's absolutely amazing that you're on top of this. 💯💯💯 |
Describe the bug
My project is using Yarn 2 PnP and consequently there exists no
node_modules
folder.Running
yarn start-storybook
inside my storybook project creates anode_modules/.cache/storybook/*
folder structure with files related to babel inside it.The problematic code is in
lib/core/src/server/utils/resolve-path-in-sb-cache.js
:Since I have a package.json in this sub-project folder
projectDir
will contain that path and the else-branch will be taken.The correct route to solve this? Making
cacheDirectory
a configurable variable? Checkif
node_modules
already exists before entering the else-clause? Maybe a combination of both?I have tried both strategies and they both seem to work. Arguably it is more user friendly if things worked right out of the box which would favour the second solution.
The text was updated successfully, but these errors were encountered: