dpa99c / cordova-check-plugins

A CLI tool to check for / manage plugin updates in Cordova/Phonegap projects.
217 stars 25 forks source link

Enhancement of the output when a plugin is not really updated #27

Closed pom421 closed 5 years ago

pom421 commented 6 years ago

I suggest an enhancement of the output, if possible.

When i use the CLI, i see that 3 plugins may be updated :

plugin: cordova-plugin-device
source: npm://cordova-plugin-device@^2.0.1
installed version: 2.0.1
remote version: 2.0.1

***************************
* Plugin update available *
***************************
plugin: cordova-android-support-gradle-release
source: npm://cordova-android-support-gradle-release@^1.1.5
installed version: 1.1.5
remote version: 1.2.0

plugin: cordova-plugin-file
source: npm://cordova-plugin-file@6.0.1
installed version: 5.0.0
remote version: 6.0.1

plugin: es6-promise-plugin
source: npm://es6-promise-plugin@4.2.2
installed version: 4.1.0
remote version: 4.2.2

So i use the option to update them interactively

cordova-check-plugins --update=interactive

? Update 'es6-promise-plugin from 4.1.0 to 4.2.2? Yes

? Update 'cordova-plugin-file from 5.0.0 to 6.0.1? Yes

? Update 'cordova-android-support-gradle-release from 1.1.5 to 1.2.0? Yes

So the ouput seems suggest that the 3 plugins have been updated.

But the asumption is wrong, only the third one is updated. The first two don't have been updated because these exact versions are required by other plugins.

So it would be handy to have an ouput to reflect that at the time a plugin is updating (for example "this plugin can't be updated because it is a dependency of ...").

John-Henrique commented 5 years ago

This is happening with me too

dpa99c commented 5 years ago

I've been able to reproduce this issue with the following test case, so should now be able to diagnose+fix it:

console output ``` $ cordova create test && cd test Creating a new cordova project. $ cordova platform add android@latest Using cordova-fetch for cordova-android@latest Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: io.cordova.hellocordova Name: HelloCordova Activity: MainActivity Android target: android-27 Android project created with cordova-android@7.1.1 Android Studio project detected Android Studio project detected Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project Installing "cordova-plugin-whitelist" for android This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in. Adding cordova-plugin-whitelist to package.json Saved plugin info for "cordova-plugin-whitelist" to config.xml --save flag or autosave detected Saving android@latest into config.xml file ... $ cordova plugin add cordova-plugin-file@5.0.0 Installing "cordova-plugin-file" for android Android Studio project detected The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml. If this is a new application no changes are required. If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add: "" to config.xml in order for the application to find previously stored files. Adding cordova-plugin-file to package.json Saved plugin info for "cordova-plugin-file" to config.xml $ cp -R plugins/cordova-plugin-file/ plugins/cordova-plugin-file-5.0.0 $ cordova plugin rm cordova-plugin-file && cordova plugin add cordova-plugin-file@* Uninstalling cordova-plugin-file from android Android Studio project detected Removing "cordova-plugin-file" Removing plugin cordova-plugin-file from config.xml file... Removing cordova-plugin-file from package.json Installing "cordova-plugin-file" for android Android Studio project detected The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml. If this is a new application no changes are required. If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add: "" to config.xml in order for the application to find previously stored files. Adding cordova-plugin-file to package.json Saved plugin info for "cordova-plugin-file" to config.xml $ rm -Rf plugins/cordova-plugin-file $ mv plugins/cordova-plugin-file-5.0.0/ plugins/cordova-plugin-file $ cordova plugin ls cordova-plugin-file 5.0.0 "File" cordova-plugin-whitelist 1.3.3 "Whitelist" $ cordova plugin add cordova-plugin-file-transfer Installing "cordova-plugin-file-transfer" for android Plugin dependency "cordova-plugin-file@5.0.0" already fetched, using that version. Dependent plugin "cordova-plugin-file" already installed on android. Android Studio project detected Adding cordova-plugin-file-transfer to package.json Saved plugin info for "cordova-plugin-file-transfer" to config.xml $ cordova-check-plugins -v 4.0.2 $ cordova-check-plugins --update=auto ********************** * Up-to-date plugins * ********************** plugin: cordova-plugin-whitelist source: npm://cordova-plugin-whitelist@1 installed version: 1.3.3 remote version: 1.3.3 plugin: cordova-plugin-file-transfer source: npm://cordova-plugin-file-transfer installed version: 1.7.1 remote version: 1.7.1 *************************** * Plugin update available * *************************** plugin: cordova-plugin-file source: npm://cordova-plugin-file@* installed version: 5.0.0 remote version: 6.0.1 Updated 'cordova-plugin-file' from 5.0.0 to 6.0.1 Automatically updated all outdated plugins $ cordova plugin ls cordova-plugin-file 5.0.0 "File" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-whitelist 1.3.3 "Whitelist" ```
dpa99c commented 5 years ago

Fixed in v4.0.3 by 3aaac438b8f1fdefce03994d86df63ce801c4dac