counterfact icon indicating copy to clipboard operation
counterfact copied to clipboard

Put all generated types under a "types" directory

Open pmcelhaney opened this issue 1 year ago • 3 comments

A fairly simple change:

  • path-types -> types/paths
  • components -> types/components
  • paths -> routes

I think it will be easier to understand what's what. The structure of the types directory should resemble the structure of the OpenAPI spec. And "routes" is a clearer indicator of what the directory contains.

I don't like to catch people off guard with disruptive changes like this. If we're going to do it, it should be before 1.0.

pmcelhaney avatar Apr 15 '24 14:04 pmcelhaney

Maybe there can be a grace period with backwards compatibility. If a paths directory is detected, Counterfact will continue to use the old structure but print a warning with migration instructions. (It's a matter of renaming a couple of directories and then doing a search and replace.)

pmcelhaney avatar Apr 15 '24 14:04 pmcelhaney

I do think the renaming is better. Not so worried about the breaking change, pre-1.0 but rather than supporting both, what about a migration script that just moves everything to the new places?

dethell avatar Apr 15 '24 15:04 dethell

Could write a migration script. I just don't want to inflict unexpected changes on people.

After 1.0 I'm going to start promoting. I'd rather get this sort of thing out of the way before more users come.

pmcelhaney avatar Apr 16 '24 00:04 pmcelhaney