Lerna support
react-spring uses lerna in the new v9 branch. Just recently, a contributor tried using relative-deps to avoid a duplicate peer dependency, but he hit some issues (see here). Thoughts on supporting such a setup, @mweststrate?
I don't have time to dig deeper, but you can try it out by cloning the v9 branch:
git clone https://github.com/react-spring/react-spring -b v9
cd react-spring
yarn
Ideally, you would only need to use relative-deps on the package you're using directly (eg: react-spring which exists in ./packages/react-spring). Any sub-dependencies that also exist in the monorepo (eg: @react-spring/core which exists in ./packages/core) should be installed transparently.
/cc @barry4dev
Thanks for raising @aleclarson. @mweststrate I feel the problem is related to the special characters in the name - If I use the same relative path but rename it react-spring-core, the build works (although it puts it in the wrong location in node_modules (inside
if I move "@react-spring/core": "../../githubProjects/react-spring/packages/core" to "react-spring-core": "../../githubProjects/react-spring/packages/core"
it builds (although the result is in the wrong place in node_modules)
Is this a current known limitation of relative-deps?
There is currently no package name sanitizing / transformation indeed, and
ends up in file paths literally at a couple of places, so yeah, probably
the @ needs some special handling in a few cases. Should hopefully be
easy enough to add, PR welcome :)
On Fri, Jun 28, 2019 at 9:29 PM Barry [email protected] wrote:
Thanks for raising @aleclarson https://github.com/aleclarson. @mweststrate https://github.com/mweststrate I feel the problem is related to the special characters in the name - If I use the same relative path but rename it react-spring-core, the build works (although it puts it in the wrong location in node_modules (inside
if I move "@react-spring/core": "../../githubProjects/react-spring/packages/core" to "react-spring-core": "../../githubProjects/react-spring/packages/core"
it builds (although the result is in the wrong place in node_modules)
Is this a current known limitation of relative-deps?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mweststrate/relative-deps/issues/9?email_source=notifications&email_token=AAN4NBCNENMLQCMEH4XWU4DP4ZRA3A5CNFSM4H4HIOFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY267OA#issuecomment-506851256, or mute the thread https://github.com/notifications/unsubscribe-auth/AAN4NBDIA55TGNWUCZW2J2LP4ZRA3ANCNFSM4H4HIOFA .
Thanks - will check it out 😉
Separately, to @aleclarson 's actual question - is there any way to relate the sub dependencies for a package used in a monorepo or is that also a potential to-do?
My PR fixes the folder issue, but doesn't really solve the overall issue.
I looked into this a bit further - relative-deps probably needs quite a bit of work for monorepo/lerna support, so I think unless someone wants to do the work to make it fully like yarn link, this can likely be closed ( I'll leave that to you @mweststrate ). I don't currently need it for my own purposes, since yarn link does a sufficient job.
If someone does have slashes in their package names, then this PR will now allow that to work fine IMO.
I am not familiar myself enough with lerna to know how it precisely deals with transitive and relative dependencies (afaik it links automatically, which doesn't solve the peer dep issue). If somebody needs it, and wants to take a shot at it. I think in principle they should be able to work together, but I currently don't have any use case or test setup to verify.
Released as 0.1.2
On Sun, Jun 30, 2019 at 1:32 AM Barry [email protected] wrote:
My PR fixes the folder issue, but doesn't really solve the overall issue.
I looked into this a bit further - relative-deps probably needs quite a bit of work for monorepo/lerna support, so I think unless someone wants to do the work to make it fully like yarn link, this can likely be closed ( I'll leave that to you @mweststrate https://github.com/mweststrate ). I don't currently need it for my own purposes, since yarn link does a sufficient job.
If someone does have slashes in their package names, then this PR will now allow that to work fine IMO.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mweststrate/relative-deps/issues/9?email_source=notifications&email_token=AAN4NBDG3DW77U4CEEEAG3DP47WKFA5CNFSM4H4HIOFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY4B7CY#issuecomment-506994571, or mute the thread https://github.com/notifications/unsubscribe-auth/AAN4NBDTOKVEV2PULSIWX6DP47WKFANCNFSM4H4HIOFA .