Extend Kizuna
Add your own methods to k, typed by the same Config as everything else.
k is an instance of the Kizuna class, so a class that extends it gives k methods of its own. Every route, group and identity on it stays typed by your Config.
Keep the name Kizuna, so k reads the same in every app, and build k from one class.
Check names against each other
A report that runs after another one names it, and a typo there should not compile. Your method can only check a name it can see in Config, so add the names under typescript.extend from a defineConfig of your own:
kizuna generate runs the config, so it writes what you added beside its own keys:
Read it back in your class, with a fallback for a Config that has none:
after: 'dayly' does not compile, and kizuna generate --check fails once a report is added and nobody regenerated.
What typescript.extend takes
| Value | Written as |
|---|---|
| A list of strings | A union of them, 'daily' | 'weekly' |
| An empty list | never |
| An object | An object, each key written again |
Each entry's key becomes a key of Config. defineConfig throws when a key is one Kizuna writes itself, like adapter or plugins, and when two entries use the same key.