code: function sortPackages(packages, type) {
    return setSortingLevels(packages, type).sort((a, b) => {
      return b.sortingLevel - a.sortingLevel;
    });
  }
docs: Sort packages automatically, bas'component'ed on their dependencies.