-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: use correct file in "main" of relay-compiler #2573
Conversation
I noticed this when trying out yarn PnP, which is more strict about the module resolution algorithm than node is (which is technically a bug in Yarn, cc @arcanis), but anyway: let's fix the file here! Node will fall back to `index.js`, while Yarn tried to use the non-existing `RelayCompilerPublic`
missing main here as well https://github.com/facebook/relay/blob/master/packages/react-relay/package.json |
@sibelius, that's likely not a problem (didn't test, I don't have it in my dependencies now), but I did see |
I think missing main could cause problems in another scenarios, like jest |
No, a missing main will simply fallback to |
looks like this breaks the tests, will wait until someone who understands haste more than me comments :) |
@alunyov can you take a look at this one and figure out the next steps? |
packages/relay-compiler/package.json
Outdated
@@ -10,7 +10,7 @@ | |||
"homepage": "https://facebook.github.io/relay/", | |||
"bugs": "https://github.com/facebook/relay/issues", | |||
"repository": "facebook/relay", | |||
"main": "RelayCompilerPublic", | |||
"main": "lib/RelayCompilerPublic", |
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.
Hey @Haroenv, thank you for looking into this. It looks like lib/RelayCompilerPublic
does not exist. This should probably be just ./RelayCompilerPublic
...
Can you squash your changes into single commit?
Thank you!
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.
This is exactly what the PR is for. While the file /RelayCompilerPublic
exists in the source, once published it doesn't, and the main file should be index.js instead of the non-existent file (then) RelayCompilerPublic
. I'm not sure which tooling depends on the main field, but the other packages had the lib/xxx
also listed when I checked last time. If possible, the main key can also be removed before publishing? This would also solve the issue I think.
I can squash once we decide on which way to go @alunyov
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.
We've fixed this with restructuring the gulpfile. |
Thanks! |
I noticed this when trying out yarn PnP, which is more strict about the module resolution algorithm than node is (which is technically a bug in Yarn, cc @arcanis), but anyway: let's fix the file here!
Node will fall back to
index.js
, while Yarn tried to use the non-existingRelayCompilerPublic