(dir: string, name: string)
| 2423 | } |
| 2424 | |
| 2425 | private frameworkAppliesIn(dir: string, name: string): boolean { |
| 2426 | const deps = this.gatedFrameworks.get(name); |
| 2427 | if (!deps) return true; |
| 2428 | const key = `${dir}|${name}`; |
| 2429 | const memo = this.appFrameworkMemo.get(key); |
| 2430 | if (memo !== undefined) return memo; |
| 2431 | // The nearest manifest that names ANY gated framework decides: true-sheet's |
| 2432 | // root package.json declares expo-router for its example app, and its |
| 2433 | // `docs/` Next.js app — whose own package.json declares `next` — is not |
| 2434 | // an Expo app for it. |
| 2435 | let applies = false; |
| 2436 | for (let d: string | null = dir; d !== null; d = d === '' ? null : d.includes('/') ? d.slice(0, d.lastIndexOf('/')) : '') { |
| 2437 | const declared = this.dependenciesDeclaredIn(d); |
| 2438 | if (!declared) continue; |
| 2439 | if (deps.some((dep) => declared.has(dep))) { |
| 2440 | applies = true; |
| 2441 | break; |
| 2442 | } |
| 2443 | if ([...this.gatedFrameworks].some(([other, otherDeps]) => other !== name && otherDeps.some((dep) => declared.has(dep)))) break; |
| 2444 | } |
| 2445 | this.appFrameworkMemo.set(key, applies); |
| 2446 | return applies; |
| 2447 | } |
| 2448 | |
| 2449 | private dependenciesDeclaredIn(dir: string): Set<string> | null { |
| 2450 | if (this.manifestDependencies.has(dir)) return this.manifestDependencies.get(dir)!; |
no test coverage detected