feat: create script for updating lists of ecosystems
This introduces a new script to make it easier to ensure all "lists of ecosystems" within this codebase remain up to date, including:
- the table in
docs/schema.md - the Go constants being introduced in #292
- the JSON schema in
validation/schema.json(both the pattern and the enum being introduced in #296)
To make it a bit easier, I've introduced a top-level ecosystems.json which is a map of defined ecosystems and a markdown description, sorted alphabetically (which the script also ensures) - I felt this was easier than trying to extract the list from markdown or another source, though it does mean double quotes need to be manually escaped.
I went with JSON as it can be read without requiring an external dependency, though if we use Python 3.11 we could switch to toml instead as that ships with tomllib
Example of the workflow output:
https://github.com/ossf/osv-schema/pull/292#discussion_r1811556242 made me think we should later expand ecosystems.json to include other properties like if an ecosystem supports a prefix i.e.
{
"npm": {
"description": "xyz",
"supportsSuffix": false
}
}