-
Notifications
You must be signed in to change notification settings - Fork 522
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
feat(examples): add Jest example #1274
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
Note that this is not working yet since I can't get the autogenerated rule to resolve |
@Globegitter I'm following the threads of your work on this. @purkhusid if the problem is really that
but this doesn't seem to change anything for me. Let's skip that for now and unroll the macro one step.
note the Even then, the failure still seems like a syntax error, not a module resolution problem:
|
@alexeagle
I believe that it's acutally babel that is complaining about not finding the package so this might be more complicated than I had imagined. So we actually have a dependency chain that looks like this:
The runfiles folder structure looks like this:
Is there any reason for that we can not symlink |
@alexeagle @Globegitter If there are any ideas on how we might be able to recreate the traditional Node folder structure within the runfiles then I could take a stab at it. Bazel is still kind of new to me so I don't know all the available tools. |
This PR adds an example of how you might create a Jest rule Unfortunately Jest does not handle symlinks very well so we have to add some patches so that it behaves correctly(See: jasongwartz/bazel_rules_nodejs_contrib#4 (comment))
Also a bit of cleanups
4a78ad6
to
2eeba30
Compare
I fixed the node_modules layout in bc848f9 - the Jest example is passing for me now. We should take out some of the patches and put them into the new bazel_require_script.js whose job is to patch the nodejs environment before calling the entry script. |
@purkhusid could you sign the CLA so I can merge this if green? |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@alexeagle You want the missing |
2eeba30
to
34755a0
Compare
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.
Cool, let's get this in, next step is for @soldair to delete the patches by making the bazel_require_script do the right thing
Doesn't work for me. |
This PR adds an example of how you might create a Jest rule
Unfortunately Jest does not handle symlinks very well so we have to add some patches so that it behaves correctly(See: jasongwartz/bazel_rules_nodejs_contrib#4 (comment))
PR Type
What kind of change does this PR introduce?