cordova-common
cordova-common copied to clipboard
Fluent interface for ConfigParser
Implement a Fluent interface for ConfigParser.
As a developer, I want to do
new ConfigParser('...')
.addEngine(...)
.addPlugin(...)
.write();
Should be possible as a non-breaking change. If in doubt, we could export something like the following as a first step:
class FluentConfigParser extends ConfigParser {
addPlugin (...args) {
return (super.addPlugin(...args), this);
}
addEngine (...args) {
return (super.addEngine(...args), this);
}
}
This would be good, however I think we're wanting to move plugins/platforms out of ConfigParser (and hence config.xml). I'll make sure my suggestion for PackageHelper supports this though.
A Fluent Interface for all remaining non-getters is still desirable, IMHO.