Closed samhh closed 1 year ago
To allow merging commands across external and internal, the internal stuff could be moved into external but hidden from -h
with the hidden
modifier. I suppose our internal lints would need to be hidden behind a flag as well.
Here are all the commands we currently support:
The first four all happen to provide different outputs. Namely, respectively:
Internal lints could be behind a hidden --internal
flag on intlc lint
. Plural expansion outputs ICU JSON like flattening.
I'm not sure how to design a safe, extensible, comprehendible CLI in which you can mix and match compatible commands. I can however imagine the following, which would be functionally as flexible as what we have today. It'd theoretically allow for performance optimisations as everything you'd need for a given output would be packed into a single call to intlc:
--expand-plurals
flag--internal
/--with-internal
flag--flatten
and --expand-plurals
flags here, however this isn't likely to ever be a performance hot path for anyoneI think any other combinations of commands should be redundant, such as flattening or plural expansion before compiling. It's not ideal hiding plural expansion behind flattening, but then it's an internal flag that we always use in that context, so it's okay for now.
The only concern with this is how extensible it is, for example if plural expansion became something that should be external. We could wind up with countless commands and flags that all need to be available on one-another. But maybe we'll never cross that bridge.
Combining the two entrypoints would also implicitly close #191.
In Web we currently do:
This means we're parsing the input twice and compiling the output twice. It also means that our recursion schemes can't potentially fuse for better performance.
Some sort of command that combines these efficiently could make a large impact.