fix(extraction): a file-based router reads only its own app in a monorepo (#2129)

create-t3-turbo, tamagui's starter and react-native-reusables keep an Expo
app beside a Next.js app. Expo Router read the Next app's `app/` folder as
its own, so `layout.tsx` became a `/layout` screen, `page.tsx` a `/page`
one, `_components/posts.tsx` and `api/auth/[...all]/route.ts` screens too,
and a shared `packages/app/` library's files became screens as well.

A resolver can now name `appDependencies`; its extractor runs on a file
only when that file's package.json or an enclosing one declares one of
them. When no manifest in the project declares any, detection found the
framework by other evidence and it runs everywhere, as before. Expo Router
names `expo-router`, Next.js `next`.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-09-30 06:32:33 +00:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 1ef1eb886c
commit 92e14eda40
6 changed files with 170 additions and 4 deletions
+1
View File
@@ -713,6 +713,7 @@ function scoreMatch(href: string[], route: string[]): number | null {
export const expoRouterResolver: FrameworkResolver = {
name: 'expo-router',
languages: [...ROUTE_LANGUAGES],
appDependencies: ['expo-router'],
detect(context: ResolutionContext): boolean {
if (dependsOn(context, 'expo-router')) return true;
+1
View File
@@ -222,6 +222,7 @@ export function nextNavVerb(name: string): string | null {
export const nextjsResolver: FrameworkResolver = {
name: 'nextjs',
languages: [...ROUTE_LANGUAGES],
appDependencies: ['next'],
detect(context: ResolutionContext): boolean {
if (dependsOn(context, 'next')) return true;