-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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 support for new yarn workspaces config format #4001
Conversation
The build error I'm seeing: TypeError: Cannot read property 'loose' of undefined (While processing preset: "/tmp/tmp.uBrV9CToKQ/yarn-ws/node_modules/babel-preset-react-app/index.js") This doesn't seem related to my change.. |
@bradfordlemley how does this fit with the monorepo work you're doing? |
Cool! Note: #3997 fixes the "'loose' of undefined" error and also moves the code that this PR is modifying. |
Thanks for the heads up! I'll be glad to update my PR as soon as #3997 is merged. |
@bradfordlemley I see the PR was merged. I'm updating mine now. It's still going to be a one-liner. Should I add a test? If so, is there a similar test I could base it off of? I'm not at all familiar with CRA's test suites since this is my first code commit. |
Tests are in e2e-monorepos.sh. In my opinion, an additional test isn't necessary. |
Alright, I've updated it. I manually tested by doing this:
All worked fine. Let me know if I need to do anything else! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Add support for new yarn workspaces config format (facebook#4001)
)" This reverts commit 9690bc8.
With the addition of the nohoist feature, yarn has enabled a new optional format for the
workspaces
key inpackage.json
:This feature is already available in the current yarn nightly build and I'm successfully using it with the following setup:
[email protected]
(nightly)[email protected]
(with my patch)[email protected]
(with a similar patch)With these patches applied, everything worked out-of-the-box*, aside from needing to make use of the
nohoist
option.*(obviously, I also needed to configure lerna to use yarn and workspaces)
With the nightly build of yarn installed all enabling
nohoist
required was:package.json
.yarnrc
:I could put together a demo lerna repo with my patches applied if needed, but I'm pretty busy with my current project, so if it's not necessary I won't bother.
Similarly, I'd be willing to add a new test to prove it gets the values from
workspaces.packages
when present. But I'm wondering if that's overkill for such a simple change.Let me know if you have any questions or concerns! :)