joshstevens19 / rindexer

A no-code blazing fast EVM indexer tool built in rust.
https://rindexer.xyz
MIT License
267 stars 24 forks source link

`rindexer codegen typings` leaks absolute paths #94

Closed roshanr95 closed 2 days ago

roshanr95 commented 2 weeks ago

As in the title, the command generates files which contain absolute paths. Are the generated files not supposed to be checked into VCS? If not, happy to make a PR that makes them relative.

joshstevens19 commented 2 weeks ago

Hey thanks for this yes it’s a bug feel free to fix it happily accept a PR

joshstevens19 commented 2 weeks ago

You should check them in yes because really only difference with them is the path and you tend to not want to generate them all the time

joshstevens19 commented 2 weeks ago

do you want to take this @roshanr95 if so great - i am away till next week and can fix once back if not

roshanr95 commented 2 weeks ago

Yes, I'll take this. I can either sanitize the absolute path before printing to file, or purge absolute paths in the codebase (i.e. std::env::current_dir) as much as possible if not entirely. Which option would you prefer?

joshstevens19 commented 2 weeks ago

yeah probably can just use ../../../ approach to be honest (i do not have a hard view in this as long as we fix the issue though) - awesome thanks good spot as well as would break for people when they deploy it or many using the project

roshanr95 commented 2 weeks ago

Abigen seems to convert relative paths into absolute paths internally :cry: seeing what can be done about this

joshstevens19 commented 2 weeks ago

If you don’t fine any solution I have another way we can make this work and make sure those files don’t get checked in let me know

joshstevens19 commented 1 week ago

Basically you can rewrite the file once it’s been generated.. if you don’t get round to it il do it this week as need to start up a new rindexer rust project for another project

roshanr95 commented 1 week ago

Ah ok, opened a couple of PRs with my existing changes btw. At a conference atm, so will take a week to get back to this in case it's still open.

joshstevens19 commented 4 days ago

hey not had time to look at these but I've spotted a few other places image aka in the handler itself does your fix any of that I'm not working on a project which is going to use rindexer so we can get this all fixed

joshstevens19 commented 2 days ago

should now not be valid as we bring ABI in the typings itself instead of looking at the file this just means any changes to ABI we would regen the types but that feels better anyway still one lives on in csv stuff but il fix that also