* Get the module/package structure * * Returns a tree structure of files organized by directory. * * @returns Map of directory paths to contained files
()
| 203 | * @returns Map of directory paths to contained files |
| 204 | */ |
| 205 | getModuleStructure(): Map<string, string[]> { |
| 206 | const files = this.queries.getAllFiles(); |
| 207 | const structure = new Map<string, string[]>(); |
| 208 | |
| 209 | for (const file of files) { |
| 210 | const parts = file.path.split('/'); |
| 211 | const dir = parts.slice(0, -1).join('/') || '.'; |
| 212 | |
| 213 | if (!structure.has(dir)) { |
| 214 | structure.set(dir, []); |
| 215 | } |
| 216 | structure.get(dir)!.push(file.path); |
| 217 | } |
| 218 | |
| 219 | return structure; |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Find circular imports between files |