Github user riknoll commented on the pull request:

    https://github.com/apache/cordova-lib/pull/432#issuecomment-220467601
  
    I think that the issue might be that we need to separate inserting child 
elements and editing existing ones. Something like this:
    
    ```xml
    <!-- Editing attributes in existing elements -->
    <edit-config target="xpath/nonsense" mode="merge|overwrite">
        <attribute name="attr" new-value="edited" />
    </edit-config>
    
    <!-- Existing config-file insert behavior -->
    <insert-config parent="xpath/nonsense">
        <child-element />
    </insert-config>
    ```
    
    This is a bit more verbose if you have a lot of edits that need to be 
performed, but much more flexible because the xpath selector can be used to 
reference specific elements, even in lists. It might also help with detecting 
plugin conflicts. I don't care about the names of those tags (we can keep using 
config-file if we want).
    
    For plugin conflicts, detection should probably happen at "plugin add" 
time. The add should fail on conflict and allow the user to override it using 
`--force` if they want to. As for which plugin gets dibs in the forced add 
scenario, it doesn't really matter as long as it is consistent. Hopefully the 
user can determine the correct value on conflict and fix it by editing the 
config from the project's `config.xml`. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to