onflow / flixkit-go

Apache License 2.0
0 stars 7 forks source link

Reorganization of code and naming #31

Closed bthaile closed 5 months ago

bthaile commented 5 months ago

Put logic into internal directory Consolidated functionality into FlixService Updated naming

bthaile commented 5 months ago

Need to return an interface so I can mock it out for unit tests in flow-cli. I could add new methods that return interfaces and leave the old ones as pass throughs.

bthaile commented 5 months ago

This is a breaking change. Is there another approach you can take?

Updated PR to not have breaking changes. Maintain the old generating binding file methods

chasefleming commented 5 months ago

Can you explain more about what this gets you and why its needed? The description isn't very clear.

bthaile commented 5 months ago

It's the same pattern used for FlixService it allows mocking out for unit tests. Also better design to return an interface instead of a concrete class.

Naming is Verb Noun, existing is GenerateTemplate, GenerateBinding. Could start interfaces with I but that doesn't seem to be the convention.

I'm open to whatever naming.

Could have interfaces named: BindingGenerator, TemplateGenerator. Change to Noun Verb and adding or

bjartek commented 5 months ago

You should consider creating a mock with mockery and publish it. That is what is done in some of the other flow libraries.

bthaile commented 5 months ago

You should consider creating a mock with mockery and publish it. That is what is done in some of the other flow libraries.

Do you have a link to a pattern that you think works well?

bjartek commented 5 months ago

Flow cli has some mockery. Just search for it there. I like the expecter options

bjartek commented 5 months ago

Flow cli has some mockery. Just search for it there. I like the expecter options

Sorry for the short comment. On my way! To bed

bthaile commented 5 months ago

Reorganized the code base. Better naming convention. Added binding file generator to main Flix service, they both need to fetch flix templates. Kept Template generator as it's own since it's functionality is isolated from the rest.