-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Core: Replace cpy
with fs-extra
copy/copyFile
#18497
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 7bb68e4. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
cpy
with fs-extra
copy/copyFile
I've done something very similar in my 7.0 future branch! 👍 Thank you for this @strmer15 👏 |
No problem! Thanks for reviewing @ndelangen ! |
Congrats on your first merged PR to storybook! 🎉 |
Issue: #15174
What I did
Replaces the
cpy
library used by@storybook/core-server
with the previously-installedfs-extra
library. Thecpy
function was copying two things: the favicon and the contents ofprebuiltDir
.For copying the favicon, I used the
copyFile
function, which needs to have the full paths of both the source and destination file, so I changed the destination to append thebasename
of the favicon to the output directory.For copying the
prebuiltDir
, thecopy
function infs-extra
will copy the contents of a directory into another directory recursively, which seems like is exactly whatcpy
was doing before. The only difference that I could see between the old use ofcpy
andfs-extra
was thatfast-glob
follows symlinks by default whereasfs-extra
only seems to do so whendereference
istrue
, so I added that option. (fast-glob
is used byglobby
which is used bycpy
)How to test
yarn test
completes successfullyyarn build-storybook
in theexamples/cra-ts
directory works correctlyUnfortunately, I couldn't figure out how to get the
prebuildDir
to show up - I added some logging to see if it ever got triggered, but none of the examples seemed to exercise it. I'm not sure how to enable that option to verify that it's working and would appreciate some help!If your answer is yes to any of these, please make sure to include it in your PR.