Updating Cordova

Following the web site instructions to update Cordova: ‘Cordova remove iOS’ followed by ‘Cordova install iOS’ replaces your project files (html and more) with the default Cordova app; it is then a pain to recover the original app from backup (invariably needs loads of work to get it back to where it was). Tried to find a way of updating corona (to new ver 6) without the hassle described but without success.
Since this upgrade will impact many F7 users, I am hoping someone has discovered how to upgrade without the pain (btw: using Cordova upgrade… gives an error message that in place upgrade not available)

If you setup a project using the F7 guidelines and Cordova documentation, you should not have any issues with updating Cordova (using npm) or updating the platform versions (cordova platform add/remove ios/android) inside your project. You should work in the root www folder inside your F7 project, that folder is never touched by updates.

that is what I have been trying - ‘Cordova platform remove iOS’ deletes my entire iOS folder including all the Cordova stuff and my www root. Am I missing something?

That’s indeed the correct way to update your platforms. But you should never touch files/folders inside the platform folders. If you don’t use the Framework7 CLI but a regular cordova project, your folder structure looks like this:

Schermafbeelding 2020-06-05 om 16.10.30

Never work directly in platforms/android/www and platforms/ios/www, but work in the root www folder. (which is the last folder, expanded in above screenshot) After you’ve made changes to your app files, run cordova prepare from command line. It will copy your www folder to the installed platforms, and for example also runs plugin hooks.

Using the Framework7 CLI, it should be almost the same, but I’m not yet familiar with it.

many thanks for the explanation - I have been keeping my www folder in platforms/iOS/www so clearly was never going to get the upgrade or remove/add to work. I will start again from first principles - a bit more work but should stop me needing this sort of help again!
Appreciate your help…