apache / cordova-common

Apache Cordova Common Tooling Library
https://cordova.apache.org/
Apache License 2.0
39 stars 46 forks source link

refactor(PlatformMunger): DRY & simplify config munging #162

Closed raphinesse closed 3 years ago

raphinesse commented 3 years ago

Motivation and Context

Config munging is a core aspect of Cordova and a source of many issues for us. When reading the code to find causes of reported issues (like #156), I noticed that much of the existing code is really verbose and repetitive, making it hard to grasp what's going on.

So I went ahead and refactored the whole thing a bit, hopefully making it more approachable in the future.

Description

Hopefully, the commit messages provide enough context to see what's going on. I took great care to make the diffs most obvious whenever possible.

Testing

The existing unit tests still pass with one small change pertaining to an implementation detail.