( snapshot: GitSnapshot, root: string, )
| 619 | }; |
| 620 | |
| 621 | const writeAxisRegistry = async ( |
| 622 | snapshot: GitSnapshot, |
| 623 | root: string, |
| 624 | ): Promise<void> => { |
| 625 | const axisPaths = snapshot.paths.filter((path) => |
| 626 | /^axisregistry\/Lib\/axisregistry\/data\/[^/]+\.textproto$/.test(path), |
| 627 | ); |
| 628 | if (axisPaths.length === 0) |
| 629 | throw new Error('No Google axis registry files found'); |
| 630 | const registry: Record<string, unknown> = {}; |
| 631 | for (const path of axisPaths) { |
| 632 | const axis = parseProto<GoogleAxisProto>( |
| 633 | axisProto, |
| 634 | snapshot.read(path).toString('utf8'), |
| 635 | ); |
| 636 | const tag = axis.tag ?? ''; |
| 637 | registry[tag] = { |
| 638 | name: axis.display_name, |
| 639 | description: axis.description, |
| 640 | min: axis.min_value, |
| 641 | max: axis.max_value, |
| 642 | default: axis.default_value, |
| 643 | precision: axis.precision, |
| 644 | }; |
| 645 | } |
| 646 | await writeJson(join(root, 'axes.json'), axisRegistrySchema.parse(registry)); |
| 647 | }; |
| 648 | |
| 649 | const inspectFamilySources = async ( |
| 650 | snapshot: GitSnapshot, |
no test coverage detected