repogen icon indicating copy to clipboard operation
repogen copied to clipboard

[Feature] allow cross pkg generate

Open hhow09 opened this issue 1 year ago • 2 comments

Issue

https://github.com/sunboyy/repogen/issues/41

Feature

  • package.Package add field Path to locate itself.
  • add flag model-dir and dest-pkg
  • code.Struct add field PackageAlias to represent imported type and update parser accordingly
  • parse model package conditionally

hhow09 avatar Feb 27 '24 05:02 hhow09

this should merge after https://github.com/sunboyy/repogen/pull/44. It should automatically solve the current issue of missing package alias of generated UserRepository.

hhow09 avatar Feb 27 '24 15:02 hhow09

I am still not totally understand your code, but I will try to learn as I review it. The change requests may come up as I gradually learn your code.

sunboyy avatar Feb 27 '24 15:02 sunboyy

Hi! I have just refactored the code to utilize the go/types and go/packages modules which should make this task far easier to implement than before. Are you still willing to work on this?

sunboyy avatar May 15 '24 13:05 sunboyy

Hi! I have just refactored the code to utilize the go/types and go/packages modules which should make this task far easier to implement than before. Are you still willing to work on this?

sure, glad to see the new refactoring! Let me follow up the changes.

hhow09 avatar May 15 '24 18:05 hhow09

opened another PR https://github.com/sunboyy/repogen/pull/49

hhow09 avatar May 16 '24 16:05 hhow09