Skip to content
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

Lerna support #9

Open
aleclarson opened this issue Jun 28, 2019 · 7 comments
Open

Lerna support #9

aleclarson opened this issue Jun 28, 2019 · 7 comments

Comments

@aleclarson
Copy link

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

@barrymay
Copy link

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?

@mweststrate
Copy link
Owner

mweststrate commented Jun 29, 2019 via email

@barrymay
Copy link

Thanks - will check it out 😉

@barrymay
Copy link

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?

@barrymay
Copy link

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.

aleclarson pushed a commit to pmndrs/react-spring that referenced this issue Jun 30, 2019
Removed mention of "relative-deps" since it doesn't connect monorepo dependencies
  (see here: mweststrate/relative-deps#9)
aleclarson pushed a commit to pmndrs/react-spring that referenced this issue Jun 30, 2019
Removed mention of "relative-deps" since it doesn't connect monorepo dependencies
  (see here: mweststrate/relative-deps#9)
@mweststrate
Copy link
Owner

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.

@mweststrate
Copy link
Owner

mweststrate commented Jul 5, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants