-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ionic CLI reformatting config.xml #2230
Comments
Hey! Thanks for opening an issue with us. What version of the cli are you running? (you can get this info from running |
From @arcreative on May 8, 2017 15:23 Oops, sorry! Looks like 2.2.3:
|
All good, thanks for the info! Would you mind installing the latest beta version of the cli (instructions here) and seeing if you have the same issue? Also, just to confirm, you are using ionic 1 right? |
From @mburger81 on May 8, 2017 19:4 I can confirm cli often rewrites config.xml and git has big diffs. |
Hmm interesting. Going to go ahead and move this issue to the CLI repo then. Thanks for the info. |
@arcreative @mburger81 This is a known issue that I'd like to look at in the future. Unfortunately, we need to modify the config.xml file for resource generation and livereloading. The xml libraries in node don't detect the indentation level, so we use the same indentation as Cordova: 4 spaces. The problem is, our starters had 2 spaces for a long time, so your app, as well as many others, likely have config.xml files that are indented with 2 spaces. This means upon the first 'cordova' command, your config.xml file is rewritten. But there shouldn't be any breaking changes, unless there's a bug in our xml library. Perhaps we can limit this by detecting whether or not we need to write the file, @jthoms1 ? |
@mburger81 if you play around with it, it shouldn't do a subsequent massive diff after the first one |
@mburger81 With the new release of Ionic v3 we will no longer be modifying the package.json file. Also the config.xml rewrite will only occur only with 'ionic cordova run' or 'ionic cordova emulate'. That being said I second the comment by @dwieeb there isn't a good way to prevent the rewrite of config.xml. |
Infact biggest change is after using cordova commands and package.json is not changed. Thx for your great work :) |
@dwieeb @jthoms1 New in dependencies are:
and there is a new node
Do you think this is okay? It is a lot of changes and not the default I saw before using ionic. Why I'm trying to use cordova 7 instead of 6.5.0?. Upgrading Edit: Now on sdk tools to 26.0.3 you have to install grade manually But remains the question about this many installed plugins and new nodes! adds this node to package.json
Is this okay? |
@mburger81 Yes, this is all expected behavior. See https://cordova.apache.org/news/2017/05/04/cordova-7.html |
@dwieeb Thanks for the information. |
@Maziar-Fotouhi I updated CHANGELOG.md to hopefully clear some things up.
|
There is an amazing library that detects the indentation for JSON files. The algorithm is very simple, probably can be used as well for xml files? |
@dwieeb Okay, but honestly I didn't figured out in your link something about And in my opinion there is a other thing I really don't understand and I'm really not sure.
But in the node_modules folder there is only cordova-android installed, so no other plugins. But Splashscreen, webview, statusbar and other are working without any issues. Only after run again Do you think this behavior is right? Edit: |
We are also having a lot of problems with this permanent automatic config.xml- and package.json-changes since the ionic-cli has been "renewed".
And the biggest problem is that all changes seem to be vice-versa, so it's a continuous backward and forward. Most of the problems are just formatting problems. But if you have a bigger team and there are concurrent edits, there are always merge problems because almost every line has been changed which costs a lot of time and money. The version problem is a big deal because this is really breaking the builds. As side note: I cannot even blame my developers for negligence because they blame the tools and the acceptance of ionic/cordova is constantly dropping mostly among native developers. :( Without any reproaches, but in all my frustration I'm asking myself why there were that many changes in the xml- and json-serialization in the ionic-cli version with the fancy "⠧ Running command-Screen" that were really necessary? It worked perfectly before :( Edit: And while writing this, there is suddenly something new: |
@acuntex perfectly described all the major pain points I'm also experiencing. This leads to further errors as one tends to revert the changes in config.xml and package.json because they change constantly from one formating to the other. Also the fancy "⠧ Running command-Screen" leads to tons of logs on our build servers: |
Agreed with @acuntex and @corran2go. I'm getting really really close to abandoning the CLI entirely (aside from |
The bug is open for 2 month now, I don't think there is going to happen anything soon. @arcreative Any chance you could inspire us so we can get rid of ionic-cli? :) |
@acuntex I have a pretty sweet gulpfile that just needs a bit more tweaking, will see if I can share it shortly. |
Running |
@uloco @peterpan666 |
cli packages:
global packages:
local packages:
System:
|
@uloco Does it happen with every command invocation, or just when it downloads platforms/plugins? Can you verify whether it's ionic or cordova by running just the |
It should be noted, that my config.xml file should have 2 space indentation, because I am using this everywhere. I don't want to use different style for different file types. Everytime I run |
I think this is a cordova issue. But the problem is still present since months and your commit did not change anything regarding this problem for me. I thought you were addressing this issue in your commit. If this wasn't your intention, than I think this could be the wrong place for this... |
My commit is reconciling Unfortunately Cordova doesn't offer indentation detection or configuration for If this is a huge annoyance, I recommend using a precommit git hook that runs an xml formatter. |
I have written a cordova hook for reformatting |
@uloco The Ionic CLI rewrites Unfortunately, the CLI hooks available today aren't sufficient for your use case. They're only useful for running stuff before/after the build/serve process. For CLI v4, I am building a hook system which may evolve into supporting your use case, but I haven't heard much demand for this. It seems the vast majority of people are okay with 4 spaces in an xml file, but I can see why it's annoying. For the time being, the best thing I can think of is running The following is expected behavior today. You can see why formatting the file during CordovaTerminal 1
Terminal 2
Terminal 1
IonicTerminal 1
Terminal 2
Terminal 1
Terminal 2
Terminal 1
|
Thank you very much for your in depth explanation. |
Hi here please i need urgent help ...my ionic project do not have the config.xml file ....how can i add one thanks |
@TKlarissa - if you answered "No" to the "Cordova" question when doing |
i just tried ionic cordova platform add android and i had the error
"Error: ENOENT: no such file or directory, open
'/home/larissa/maibeta/myapplication/config.xml'
"
…On 20 April 2018 at 13:54, Ken Sodemann ***@***.***> wrote:
@TKlarissa <https://github.com/TKlarissa> - if you answered "No" to the
"Cordova" question when doing ionic start to create your app, you will
not have a config.xml file. It will be generated, though, if you later
add Cordova integration via ionic cordova platform add ios or ionic
cordova platform add android
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2230 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkTlbI1bdyLgOe-N-MI56cpLh1dbJ6aWks5tqdqfgaJpZM4NUYem>
.
|
@TKlarissa - what version of the CLI are you using? Please provide the output of |
please give me a solution to this please it is quit urgent
On 20 April 2018 at 14:03, Ines Larissa Koyoue <koyouelarissa95@gmail.com>
wrote:
… i just tried ionic cordova platform add android and i had the error
"Error: ENOENT: no such file or directory, open '/home/larissa/maibeta/
myapplication/config.xml'
"
On 20 April 2018 at 13:54, Ken Sodemann ***@***.***> wrote:
> @TKlarissa <https://github.com/TKlarissa> - if you answered "No" to the
> "Cordova" question when doing ionic start to create your app, you will
> not have a config.xml file. It will be generated, though, if you later
> add Cordova integration via ionic cordova platform add ios or ionic
> cordova platform add android
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2230 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AkTlbI1bdyLgOe-N-MI56cpLh1dbJ6aWks5tqdqfgaJpZM4NUYem>
> .
>
|
I am trying to, but I need the information I asked for in my prior msg (output of |
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
…On 20 April 2018 at 14:11, Ken Sodemann ***@***.***> wrote:
I am trying to, but I need the information I asked for in my prior msg
(output of ionic info)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2230 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkTlbNUHgIZemfAXlrnig_rL6s-WiurTks5tqd5sgaJpZM4NUYem>
.
|
@TKlarissa This is not a chat or support forum. Please stop spamming all of us with your posts, use Ionic forums instead if you need help. |
cordova (Cordova CLI) : 8.0.0
On 20 April 2018 at 14:14, Ines Larissa Koyoue <koyouelarissa95@gmail.com>
wrote:
…
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
On 20 April 2018 at 14:11, Ken Sodemann ***@***.***> wrote:
> I am trying to, but I need the information I asked for in my prior msg
> (output of ionic info)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2230 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AkTlbNUHgIZemfAXlrnig_rL6s-WiurTks5tqd5sgaJpZM4NUYem>
> .
>
|
@TKlarissa - OK, so you are up to date. Why not just generate a new project using If at that point you are still having issues, please go to the support forum and post something there (https://forum.ionicframework.com) |
Can I have the link to the forum ?
…On Fri, Apr 20, 2018, 14:15 Radoslav Vitanov ***@***.***> wrote:
@TKlarissa <https://github.com/TKlarissa> This is not a chat or support
forum. Please stop spamming all of us with your posts, use Ionic forums
instead if you need help.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2230 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkTlbDqxrOWU04C7Jg6vF2NQqlTdXOLzks5tqd9_gaJpZM4NUYem>
.
|
Ok thanks for your help let me try it
On Fri, Apr 20, 2018, 14:21 Ines Larissa Koyoue <koyouelarissa95@gmail.com>
wrote:
… Can I have the link to the forum ?
On Fri, Apr 20, 2018, 14:15 Radoslav Vitanov ***@***.***>
wrote:
> @TKlarissa <https://github.com/TKlarissa> This is not a chat or support
> forum. Please stop spamming all of us with your posts, use Ionic forums
> instead if you need help.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2230 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AkTlbDqxrOWU04C7Jg6vF2NQqlTdXOLzks5tqd9_gaJpZM4NUYem>
> .
>
|
From @arcreative on May 8, 2017 14:12
Ionic version: (check one with "x")
[X] 1.x
[ ] 2.x
[ ] 3.x
Note: just the CLI, don't think the project version matters here
I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
ionic build ios
completely rewrites myconfig.xml
andpackage.json
files with trivial whitespace and other changes. There could be breaking changes, but it's very hard to tell because everything is completely rearranged.Expected behavior:
Leave my stuff alone!
Steps to reproduce:
run
ionic build ios
Copied from original issue: ionic-team/ionic-framework#11558
The text was updated successfully, but these errors were encountered: