-
Notifications
You must be signed in to change notification settings - Fork 682
Description
There are multiple ionic commands that mess with the default "config" files cordova.xml and package.json and by that create unnecessary changes that have to be checked in with Git. Here are some examples for a project created with the blank template:
-
ionic cordova platform add androidremoves empty lines + comments and changes the ordering of<icon>attributes inconfig.xml. Inpackage.jsonit changes the indendation from 2 spaces to 4 spaces:
https://github.com/janpio/ionic-default-files-messing/commit/3db056994ff89256d6b94e03c8e8074df4a53e22 -
ionic cordova resourcesreplaces the existing images with the exact same images - same file size, pixel identical. Looking at the binary of the images it seems only some dates in metadata (?) at the end of the file is different. Should this be in the files at all?
https://github.com/janpio/ionic-default-files-messing/commit/f58c2de710ba271d7cd9234335ce11fa739d1c5f -
ionic cordova run androidthen completely rewriteconfig.xmlagain. It changed"to'in the<?xml>tag, and removedstandalone="yes"completely from it. Then it added spaces in front of the closing/in all the tags, moved the density attribute of<icon>for android to the front of the tag, and completely resorted the<plugin>s in the bottom.
https://github.com/janpio/ionic-default-files-messing/commit/c440bec7e46dd28882bbdc5bc2e7288bffdd85bf
Of course you can now say "well, only cosmetic changes, no functionality change, doesn't matter" and you would be technically correct of course. But for beginners (and old timers getting confused easily...) this is a real and unnecessary burden.
(Could someone please execute the same commands on Mac OS or Linux to see if this is reproducible? I only tested this on Windows 10 for now)
Can the CLI be improved so this doesn't happen?
Can or should the default config.xml and package.json be adapted to their "intended" format?