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
deps(robots-parser): patch robots-parser to work in both node and browser env #4819
deps(robots-parser): patch robots-parser to work in both node and browser env #4819
Conversation
@@ -0,0 +1,36 @@ | |||
patch-package | |||
--- a/node_modules/robots-parser/Robots.js |
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.
a diff of a diff 😵
Presumably this also needs some post install script to apply the patch? |
@paulirish I also thought so, but …
🕺 [EDIT] oh whoops, I guess I was too optimistic thinking that it's a build-in npm/yarn functionality - you are right, post install script is needed 😢 |
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.
LGTM!
Yeah patch-package is awesome! |
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.
Is there a long term path for a real fix?
Yeah, I agree it's not perfect. I thought about opening a PR with this patch against the original repo. We can also pull that library into LH or fork it. |
PR to have robots-parser use real |
+1 to giving @samclarke a PR. |
Perfect, I'll open a PR👍 should I create an issue to track this? |
SGreatTM |
that SG too |
Issue created (#4825) 👌 |
I've tried creating a browserify transform that replaces
request('url')
calls withrequest('path/to/url-shim.js')
. It worked, but uncovered another issue - robots-parser is usingurl.path
that doesn't exists on the web and is deprecated in node. So I decied to go with https://github.com/ds300/patch-package as suggested by @patrickhulce and @wardpeet.Fixes #4794, but nothing will show up in the details table due to #4818