(indexPath: string)
| 172 | * avoid the per-entry file read + DOMParser cost. |
| 173 | */ |
| 174 | export function loadProjectVariableSchema(indexPath: string): ProjectVariableSchema { |
| 175 | let html: string; |
| 176 | try { |
| 177 | html = readFileSync(indexPath, "utf8"); |
| 178 | } catch { |
| 179 | return []; |
| 180 | } |
| 181 | // extractCompositionMetadata uses DOMParser, which Node doesn't ship. |
| 182 | // Same pattern as `compositions.ts` and other CLI commands that touch |
| 183 | // @hyperframes/core's HTML parsers. |
| 184 | ensureDOMParser(); |
| 185 | return extractCompositionMetadata(html).variables; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * Validate `values` against a pre-loaded schema. Empty schema means the |
no test coverage detected