by Dayshine · 3y ago · 0 comments
However, it turns out it's really annoying to use text based config for most things. Primarily because integrations can't edit your config, so you have to do a lot more manual migration of config. Yaml also doesn't have any proper ide support, so it's an annoying loop of restarting the app and staring at logs looking for typos.
And finally the version control was useless because so much of what I wanted to keep was state, which can't be in config.
I've recently realised that I only actually needed the complex rules and UI to be in code. And they still are: now through the ui with instant validation.
I do still periodically go into the config folder and do a bulk 'bump' commit, though given the config is likely useless without the state of the database I don't know if this is ever going to be useful. Perhaps having some history is good in case a complex automation is lost but still quite limited.
Since YAML is a superset of JSON, I highly recommend converting[1] it to JSON, and then just treating it as a JSON config file.
1: For this, I use yaml2json (npm yaml-to-json)