next-type-safe-routes icon indicating copy to clipboard operation
next-type-safe-routes copied to clipboard

configuration should allow custom destination for generated types.

Open airtonix opened this issue 3 years ago • 1 comments

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/

airtonix avatar Jan 25 '22 23:01 airtonix

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).

osdiab avatar Mar 11 '22 04:03 osdiab