owid-grapher
owid-grapher copied to clipboard
Dynamically generate database constants that we can reference in code.
In the site/grapher, we have data that we hardcode to correspond with data in the DB (e.g. PUBLIC_TAG_PARENT_IDS
, POPULATION_INDICATOR_ID_USED_IN_ADMIN
, or the site navigation json)
We could create a script that automatically derives these constants and turns them into a TS file that we can import from
e.g. import { SiteNavTree } from '@ourworldindata/dynamic-constants'
Or we automatically generate the files during baking, validated with e.g. typebox.
So that the DB can be the primary source of information, without us having to asynchronously load the site nav.