-
Notifications
You must be signed in to change notification settings - Fork 954
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 remix-url-resolver not handling "github:XX" styled package.json packages #5332
base: master
Are you sure you want to change the base?
Conversation
👷 Deploy request for remixproject pending review.Visit the deploys page to approve it
|
@forefy Can you please rebase it? |
If the entry is pointing to a github repo, redirect to correct handler instead of continuing
@Aniket-Engg done :) |
@forefy which contract should be compiled from shared repo to reproduce the error? |
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 still doesn't work as handleGithubCall
method performs certain cleaning for URL and resulting URL from github:XX
style are not being resolved
@Aniket-Engg I created a temp PoC repo to demonstrate my point: https://github.com/forefy/remix-url-resolver-poc To replicate:
The difference from what I assumed you tested is how you initialize RemixURLResolver: const dependencies = {
deps: {
"forge-std": "github:foundry-rs/forge-std#v1.8.1", // This was not supported
prettier: "^3.0.0",
solhint: "^3.6.2"
}
};
const resolver = new RemixURLResolver(() => {
return dependencies;
}); |
@Aniket-Engg were you able to replicate the issue now? can we merge this in? |
POC you prepared is not able to run Please consider to add related unit test too in |
@Aniket-Engg could you please elaborate on what "not able to run ts file" refers to? Also, it would be simplest IMO to just add the code manually to resolve.js at (see https://github.com/ethereum/remix-project/pull/5332/files#diff-e4cb251c419ec85091200c75e310365042fdfef3a4ffd97cdc1e5c872b903404R177) For better clarity showing the output you should be expecting and the commands in a more detailed manner: Before - invalid comparator error on poc example
After - working
It should end up looking like this:
Then you can run And
|
Hi 👋
I'm PRing this small change in the
remix-url-resolver
in cases where the target repo specifies agithub:
styled repo instead of a regular npm version on it'spackage.json
Look at forge-std from this example
This will end up on
handleNpmImport
, which tries to parse the github:XX string as an NPM package version and errors outThe PR fixes this by just detecting the github prefix, and redirecting execution flow to the correct
handleGithubCall
handlerTo reproduce try to resolve contract repo: https://github.com/PaulRBerg/foundry-template
Please let me know if you have any questions!