(projectDir: string)
| 48 | |
| 49 | /** Read `hyperframes.json` from a project directory. */ |
| 50 | export function readProjectConfig(projectDir: string): ProjectConfig | undefined { |
| 51 | const path = projectConfigPath(projectDir); |
| 52 | try { |
| 53 | const parsed = JSON.parse(readFileSync(path, "utf-8")) as Partial<ProjectConfig>; |
| 54 | return normalizeConfig(parsed); |
| 55 | } catch { |
| 56 | // Missing file or corrupt JSON → no config. |
| 57 | return undefined; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Return a valid config — fills in any missing fields with defaults. Used |
no test coverage detected