The way cht-conf manages configuration files for contact-summary/targets/tasks makes it challenging to leverage reusable configuration modules (e.g. GitHub - medic/cht-stock-monitoring-workflow · GitHub).
Essentially, integrating any pre-defined external configuration requires custom edits to the local contact-summary.templated.js, targets.js and/or tasks.js files. These edits are difficult to reliably automate (e.g. in a post-install dependency script).
See this cht-conf issue for more details.
In feat(#566): implement auto-inclusion of task and target and contact s… by inromualdo · Pull Request #784 · medic/cht-conf · GitHub @Romuald_Dansou has worked up a solution to this problem by refactoring the structure of contact-summary/tasks/targets config to be simliar what we currently have for the app_settings.
Currently, if you init a new config project, it will load config from these files (not counting deprecated ones):
app_settings/base_settings.jsonforms.jsonschedules.json
contact-summary.templated.jstargets.jstasks.js
After Ro’s changes, the non-deprecated places to load config from will be:
app_settings/(unchanged)base_settings.jsonforms.jsonschedules.json
contact-summary/base.js
targets/base.js
tasks/base.js
In each of the contact-summary/, targets/, and tasks/ directories you can add multiple files that are merged together to form your complete configuration during compile-app-settings. This allows you to have a custom base.js file with your bespoke config and then also to have one or more other files that perhaps were loaded/generated externally that all get pulled into your app settings. You can also just spread your bespoke config across multiple files for better organization, etc.
To limit the complexity of the code changes here, we are also dropping support for nools-style configuration in cht-conf. That config has been deprecated for years since and cht-core dropped support in (Edit: technically, the normal “declarative” configuration has been supported in cht-conf since ~2018 in the 4.2.0.1.x. The deprecated “nools” configuration continued to be supported in both cht-conf and cht-core. It was the 5.0.0 release of cht-core that finally dropped support for “nools” config in cht-core.)
Posting this out here to get feedback, suggestions, comments, objections, etc from a larger group of people before we drop this in a new major version of cht-conf.
Please let us know what you think! Tag anyone else who might be interested. ![]()