googlefonts / googlefonts/fontations
Improvements to codegen tool behaviour
- Dominant language
- Rust
- Stars
- 826
- Forks
- 75
- Avg merge
- 22h 33m
- Merged PRs (30d)
- 75
Description
The codegen tool has evolved organically over time, and as we add more and more inputs it has started to bog down a bit. I would like to make two general changes:
- remove different 'file' and 'plan' modes: I would like there to be a single way to invoke the codegen tool, and this should use a plan.
- *filtering*: I would like to able to pass some argument to the tool that filters what files are rebuilt.
- change *clean* behaviour: the idea behind the *clean* stage was that if you remove a given codegen output from the plan, or if you change an output filename, it is very easy to end up holding on to copies of stale outputs. The current design is bad, though: we always run this clean step, and we delete files before we even know if codegen has succeeded. This feels bad.
Some unstructured ideas:
- for clean, we have options. Maybe the simplest approach is that we don't run it by default; instead we add an optional `all` command that does a full clean and rebuild. We can run this in CI, and that will ensure that the `generated` directories contents are fresh.
- for filtering, the best option might be to filter based on the output path? the provided argument could be a regex, but I think right now I would lean towards some kind of custom syntax; you provide an input filename, and then can optionally append a mode, with a dividing slash or something? basically you could write, `-f head` to regenerate both outputs for the `head` table, or you could write `-f head/compile` to only regenerate the `write-fonts` version? I'm just brain-storming.
In any case wanted to write this down; it isn't a huge priority but would likely be a nice QoL improvement.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.