next-type-safe-routes
next-type-safe-routes copied to clipboard
configuration should allow custom destination for generated types.
https://github.com/ckastbjerg/next-type-safe-routes/blob/e181640ec23c4eefad0b94e776c983a630281ab8/src/plugin/index.ts#L37
in our nextjs projects we write out other generated typescript .d.ts
files for our gql schema under
apps/
appname/
__generated__/
ts-gql/
.*
src/
pages/
components/
services/
etc/
etc/
etc/
we'd like to put our route types:
apps/
appname/
__generated__/
next-type-safe-routes/
.*
ts-gql/
.*
src/
pages/
components/
services/
etc/
etc/
etc/
I have another reason this is a good idea - I would love to be able to reference valid paths from another project that has redirects/API access to my NextJS project, and I use a monorepo structure - so it would be super cool if the definitions could even be sent outside the project to such a subpackage, so that I can use the getRoute()
helper fully outside of NextJS (rather than needing to have all of the NextJS project as a dependency).