ProNextJS / declarative-routing

NextJS Typesafe Routing System
MIT License
219 stars 17 forks source link

[Discussion] How to Use This Project Correctly in a Monorepo #28

Open juicyjusung opened 2 months ago

juicyjusung commented 2 months ago

Thank you for working on this fantastic project! I am using turborepo to manage my project as a monorepo. In my setup, most of the logic and components are separated into individual packages, with the next.js app serving mostly as a shell. The problem arises with the automatically generated routes/index.ts that references page.info. If I set the path of routes to the next.js app package, it becomes inaccessible to external packages. On the other hand, if I set it to an external package, it cannot reference the page.info file in the next.js app. Do you have any good ideas on how to solve this issue?

jherr commented 1 month ago

You could take the generated link components and pass them as props or context to the components in packages so they can use them when they create links.