* Check if a path is an application module (not node_modules, not vendor, not relative) * This is generic and works for ANY project structure. * * Examples of application imports: /core/v4/store.ts, /src/utils/helper.ts, /custom/module.ts * Examples of NON-application imports: node_modules/...,
(importPath: string)
| 992 | * Examples of NON-application imports: node_modules/..., ~/vendor.mjs, ./relative.ts, ../parent.ts |
| 993 | */ |
| 994 | function isApplicationImport(importPath: string): boolean { |
| 995 | if (!importPath.startsWith('/')) { |
| 996 | return false; // Relative paths (./..., ../...) are not application imports |
| 997 | } |
| 998 | |
| 999 | // Exclude node_modules and special paths |
| 1000 | if (importPath.includes('node_modules') || importPath.startsWith('/@') || importPath.startsWith('~/')) { |
| 1001 | return false; |
| 1002 | } |
| 1003 | |
| 1004 | return true; |
| 1005 | } |
| 1006 | |
| 1007 | function stripToProjectRelative(importPath: string, projectRoot?: string): string { |
| 1008 | if (!importPath) { |
no test coverage detected