Improve plugman/uninstall.js messages #630
Conversation
Looks good to me. You need to update some tests to check for the new messages, though. |
If I would do the following commands on a new Cordova project using cordova@8, npm@6.2.0 (node@10.7.0) on my mac:
then remove Uninstalling cordova-sqlite-storage from android
Android Studio project detected
Uninstalling cordova-sqlite-storage from browser
js-module uninstall called : plugins/cordova-sqlite-storage/www/SQLitePlugin.js
Uninstalling cordova-sqlite-storage from ios
Removing "cordova-sqlite-storage"
Removing plugin cordova-sqlite-storage from config.xml file...
Removing cordova-sqlite-storage from package.json I wonder if the difference is due to Windows vs mac, node/npm version, or how your project is setup? Should I try the same thing on my Windows machine? |
No need to do anything @brodybits, this is the result of another unrelated problem - it just surfaced the suboptimal error messages in this file. (This is caused by a folder Thanks @raphinesse, will do so tomorrow. Kinda (positively!) surprised this is covered by tests :) |
Thanks @janpio for the response. Shouldn't that information be in the description, and shouldn't the JIRA number be in the title? I gotta say that your use case sounds valid and interesting, not so surprised that CLI would have trouble with it. I think it would be nice to see a more clear description of your use case somewhere in JIRA and/or PR description. |
No, as this PR does nothing to solve the problem (which is described in the JIRA issue I linked to and to which a PR fixing that issue will refer to). This other problem just showed me that the error message here in this file could be better, so I created a PR directly to improve the outputs. (One could create a JIRA issue "cordova-lib/plugin/uninstall message are unclear" but that is just busy work we can skip imho - the PR here contains all the relevant information on what it does and why. [I updated the PR description a bit so it actually does this]) |
Adapted the tests and improved the initial PR description for future reference (like in the release notes and blog post etc). Thanks for the quick approval @raphinesse. |
Currently you get an error message like this if you try to uninstall a plugin while an unsupported platform (in this case a folder called
.git
) is present:(node:7428) UnhandledPromiseRejectionWarning: CordovaError: .git not supported.
The error message doesn't make it obvious that this is about a "platform". This PR fixes this to be more clear.
While fixing this one case, I also encountered other messages in the same file that could be more precise and include platform/plugin in the output, so I changed those as well.
Complete output from where I encountered it:
(Note that the fact that
.git
should probably not be handled as a platform is tracked in https://issues.apache.org/jira/projects/CB/issues/CB-14231 and not part of this issue/PR)