-
Notifications
You must be signed in to change notification settings - Fork 16
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
pnpm monorepo support - ppx resolution failing #104
Comments
I got the same issue using rescript-schema-ppx. Resolution of regular dependencies does seem to be solved by #91 but indeed PPX resolution seems to still be incorrect unfortunately. Don't hesitate to tell us what we can do to help pinpoint or solve the issue. Great job on all of this btw (+ incremental build), can't wait to switch my monorepo to rewatch! |
Thanks for the extensive explanation. It does indeed look like we're not resolving ppx's properly. We started building this with yarn, it symlinks packages in monorepos through the root node_modules. Ie - we'd need to check if it's either the root or the other path. @jfrolich - Perhaps we can try and determine from the presence of lock files wether we're dealing with Yarn or Pnpm and drop the overhead of this potential lookup? |
Thanks for the detailed explanation. For the records, I have this issue with my yarn modern (v4) monorepo setup. |
Any progress on this? |
Following the recent addition of pnpm support I was looking to move our monorepo to rewatch and noticed a couple of issues which I've reproduced in a thin repo.
Firstly, ppx binary resolution isn't working correctly when ppx dependency is from a child.
In this monorepo example (mind the branch!) we have dependencies set up as follows
@monorepo/root
has no rescript of its own, but is configured with@monorepo/main
as abs-dependency
@monorepo/main
depends on@monorepo/library
@monorepo/library
depends onrescript-logger
and uses"ppx-flags": ["rescript-logger/ppx"]
Actual outcome, running
rewatch build
in root:It's expecting the
rescript-logger
library to be hoisted to the top-level and looking up the binary there:PROJECT_ROOT/node_modules/rescript-logger/ppx
Expected outcome
Binary lookup path is non-hoisted variant:
PROJECT_ROOT/node_modules/@monorepo/main/node_modules/@monorepo/library/node_modules/rescript-logger/ppx
Let me know if I'm missing something, I'll raise a couple of other issues with similar findings in other scenarios.
The text was updated successfully, but these errors were encountered: