cordova-cli
cordova-cli copied to clipboard
In package.json, cordova plugin list is never sorted
Bug Report
Problem
In package.json, cordova plugin list is not sorted. Makes things hard to understand when adding new plugins.

What is expected to happen?
Object keys should be sorted alphabetically.
What does actually happen?
They're never sorted.
Information
Command or Code
Environment, Platform, Device
Version information
macOS High Sierra Cordova 9.0.0
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Good point. Same goes for the list of installed platforms. Could be done using either sort-object-keys or sorted-object.
@dpogue Should be added to the long list of features for https://github.com/apache/cordova-common/pull/34.
Should we move this issue to cordova-common then?
Yeah... I will mention that the order of the list in package.json is the order in which cordova prepare restores the plugins, and I've needed to manually order that list at times to avoid weird plugin installation failures 😢
So I'm not super keen on reordering this in package.json whenever a plugin is added, because that will be frustrating for people who have things in a specific order.
Ugh, that's horrifying :nauseated_face:
Not having a stable order for plugins and platforms also makes it unnessesarily difficult to understand changes in a version control system: removing an old version of a platform and adding a new one makes one line disappear and another one appear, even though only a version number changed. When you update many dependencies at once, the diff easily becomes incomprehensible.