( projectDirectory: string, baseDirectory: string, )
| 13 | const frameworks: Array<Framework> = [] |
| 14 | |
| 15 | export function scanProjectDirectory( |
| 16 | projectDirectory: string, |
| 17 | baseDirectory: string, |
| 18 | ) { |
| 19 | const absolutePaths: Record<string, string> = {} |
| 20 | findFilesRecursively(baseDirectory, absolutePaths) |
| 21 | |
| 22 | const files = Object.keys(absolutePaths).reduce( |
| 23 | (acc, path) => { |
| 24 | acc[toCleanPath(path, baseDirectory)] = absolutePaths[path] |
| 25 | return acc |
| 26 | }, |
| 27 | {} as Record<string, string>, |
| 28 | ) |
| 29 | |
| 30 | const basePackageJSON = existsSync(resolve(baseDirectory, 'package.json')) |
| 31 | ? JSON.parse(readFileSync(resolve(baseDirectory, 'package.json'), 'utf8')) |
| 32 | : {} |
| 33 | |
| 34 | const optionalPackages = existsSync( |
| 35 | resolve(projectDirectory, 'packages.json'), |
| 36 | ) |
| 37 | ? JSON.parse( |
| 38 | readFileSync(resolve(projectDirectory, 'packages.json'), 'utf8'), |
| 39 | ) |
| 40 | : {} |
| 41 | |
| 42 | return { |
| 43 | files, |
| 44 | basePackageJSON, |
| 45 | optionalPackages, |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | export function scanAddOnDirectories(addOnsDirectories: Array<string>) { |
| 50 | const addOns: Array<AddOn> = [] |
no test coverage detected