I am starting a new project for work based on nextjs for a large ecommerce website hosted in AWS that will be maintained by multiple teams with different repos and release cadences.
Based on existing team structures and release cadences, I would like to have separate repos for different parts of the site based on root path, and also have a shared repo for things like the root layout and shared components like site header and footer.
Is there a way to reuse routing parts like pages/layouts using app router across npm module boundaries, so things like middleware and root layouts can be managed as npm dependencies?
An example of reuse would be a root layout that injects the site header and theme information so that each sub directory wouldn't be inserting the site's header and top level CSS, site skeleton, etc.