Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not configurable where the types will be stored #18

Closed
osdiab opened this issue Nov 11, 2021 · 4 comments
Closed

Not configurable where the types will be stored #18

osdiab opened this issue Nov 11, 2021 · 4 comments

Comments

@osdiab
Copy link
Collaborator

osdiab commented Nov 11, 2021

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
Copy link
Owner

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
Copy link
Collaborator Author

osdiab commented Nov 12, 2021

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
Copy link
Owner

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

@ckastbjerg
Copy link
Owner

Will close since this has become a duplicate of #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants