AVIator icon indicating copy to clipboard operation
AVIator copied to clipboard

Preserve directory structure, ignore tests, etc. refactoring for ethers-contract-abigen

Open meetmangukiya opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Currently, it seems like we generate bindings either as multiple files or single file depending on args, if single file, everything is written to a single file, if multiple file, we create one file per contract and include those in lib.rs or mod.rs depending on what the user selected, to generate a crate or a module.

Tried this out recently, but see a few problems(?):

  1. Everything is generated at top level src/..contract.rs, not quite nice.
  2. Everything in artifacts dir gets generated, usually we'd want to ignore the contracts defined in :tests/ or :src/tests.

Describe the solution you'd like

  1. src/... contracts get generated in same directory structure as in source and follows same module structure.
  2. lib/... contracts get generated the same way as in 1, but under a reserved dir like vendor / third_party directory

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

meetmangukiya avatar May 22 '22 17:05 meetmangukiya