ckastbjerg / next-type-safe-routes

Never should your users experience broken links again!
MIT License
70 stars 5 forks source link

Not configurable where the types will be stored #18

Closed osdiab closed 2 years ago

osdiab commented 3 years ago

The plugin stores the typing at src/@types/next-type-safe-routes, but for my other types I had been putting them at src/types/... so using this library is imposing the particular location on me - would rather it were a bit more configurable, but it's not a big deal for me to move the existing files for consistency.

ckastbjerg commented 3 years ago

Not sure if I understand you request correctly...

Would you like the generated types to be in the same folder as the "regular" types you define for your project? My idea was to dump this file in the src/@types so that it doesn't interfere with your other types and so that you "automagically" get the correct type when doing e.g.:

import { getRoute } from "next-type-safe-routes";

I'm of the impression that it's conventional to have a @types folder for defining/overriding types from external packages, but again, I'm not quiet sure what you want to achieve? :)

osdiab commented 3 years ago

Yeah, it is common, but I had just named that folder differently, so using this project made me feel compelled to move all my other typings so that i can abide by the directory pattern this project chose - I think that while src/@types is a reasonable default, i'm just suggesting that it's a nice-to-have to be able to set it so that this project doesn't dictate the user's folder hierarchy.

ckastbjerg commented 3 years ago

Ok. Makes sense. I'm totally fine making the output destination configurable as you suggest :)

ckastbjerg commented 2 years ago

Will close since this has become a duplicate of #32