* The resolution edges out of route nodes that a change to `filePaths` can * move: from a route in another file, to a node of one of `filePaths`, or to * a value declared beside the route — what a route rendering * `const Docs = lazy(() => import('./pages/Docs'))` binds to while that * m
(filePaths: readonly string[])
| 5425 | * resurrect and are left out. |
| 5426 | */ |
| 5427 | getRouteEdgesMovedBy(filePaths: readonly string[]): Array<Edge & { |
| 5428 | edgeId: number; |
| 5429 | sourceFilePath: string; |
| 5430 | sourceLanguage: Language; |
| 5431 | }> { |
| 5432 | if (filePaths.length === 0) return []; |
| 5433 | const files = JSON.stringify(filePaths); |
| 5434 | const rows = this.db |
| 5435 | .prepare( |
| 5436 | `SELECT e.*, src.file_path AS source_file_path, src.language AS source_language |
| 5437 | FROM nodes src |
| 5438 | JOIN edges e ON e.source = src.id |
| 5439 | JOIN nodes tgt ON tgt.id = e.target |
| 5440 | WHERE src.kind = 'route' |
| 5441 | AND e.kind != 'contains' |
| 5442 | AND (e.provenance IS NULL OR e.provenance != 'heuristic') |
| 5443 | AND src.file_path NOT IN (SELECT value FROM json_each(?)) |
| 5444 | AND (tgt.file_path IN (SELECT value FROM json_each(?)) |
| 5445 | OR (tgt.file_path = src.file_path AND tgt.kind IN ('constant', 'variable'))) |
| 5446 | ORDER BY e.id` |
| 5447 | ) |
| 5448 | .all(files, files) as Array<EdgeRow & { source_file_path: string; source_language: Language }>; |
| 5449 | return rows.map((row) => ({ |
| 5450 | ...rowToEdge(row), |
| 5451 | edgeId: row.id, |
| 5452 | sourceFilePath: row.source_file_path, |
| 5453 | sourceLanguage: row.source_language, |
| 5454 | })); |
| 5455 | } |
| 5456 | |
| 5457 | /** |
| 5458 | * Every resolution edge leaving a node of `language` — the re-resolution set |
no test coverage detected