adiktofsugar / diff-package-lock

Show more useful diffs of your package-lock.json file
6 stars 2 forks source link

Feature Request - Group/Sort by Major vs Minor vs Patch #43

Open kerbs17 opened 1 year ago

kerbs17 commented 1 year ago

I would love to be able to have the output sorted or grouped at each level so that I can clearly see which updates are Adds, Removes, Major Versions, Minor Versions, or Patch Versions.

For example, this output:

├ winston@3.8.2 -> winston@3.10.0
├ @types/xml2js@0.4.11 -> @types/xml2js@0.4.12
├ - chalk@4.1.2
├ + @json2csv/plainjs@7.0.3
├ newrelic@9.15.0 -> newrelic@11.1.0

Would sort to:

├ + @json2csv/plainjs@7.0.3
├ - chalk@4.1.2
├ newrelic@9.15.0 -> newrelic@11.1.0
├ winston@3.8.2 -> winston@3.10.0
├ @types/xml2js@0.4.11 -> @types/xml2js@0.4.12

If any of the dependencies had child dependency updates, they would also be sorted underneath their parent.

adiktofsugar commented 1 year ago

I'll have to figure out how that works with workspaces. I don't mind sorting the changes that way, though, as right now they're either not sorted or are sorted randomly / alphabetically.

On Mon, Sep 18, 2023, 17:24 Kevin Kerber @.***> wrote:

I would love to be able to have the output sorted or grouped at each level so that I can clearly see which updates are Adds, Removes, Major Versions, Minor Versions, or Patch Versions.

For example, this output:

@. -> @. ├ @@. -> @@. ├ - @. ├ + @@.@. -> @.

Would sort to:

├ + @@. ├ - @.@. -> @.@. -> @. ├ @@. -> @@.

If any of the dependencies had child dependency updates, they would also be sorted underneath their parent.

— Reply to this email directly, view it on GitHub https://github.com/adiktofsugar/diff-package-lock/issues/43, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACH7LZUK6HGUD5ESRHDITDX3C3XLANCNFSM6AAAAAA45KQSDU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

adiktofsugar commented 1 year ago

This may require a pretty big rewrite. Currently everything works through recursive functions. To enable reliable sorting I'd have to prepare the entire list first. That is probably a good idea for the code and maybe I can make it faster for large workspaces, so I'm not against it but it may take a little bit.

kerbs17 commented 1 year ago

I appreciate you looking into it and getting back. It's something that would be nice to have, but isn't a deal-breaker or anything for me. Free free to close if you don't think you'll get to it. Thanks!

adiktofsugar commented 1 year ago

I'll get to it. I just use comments to add notes for myself later, I guess. Haha. Thanks for the suggestion in the first place!

On Tue, Sep 19, 2023, 12:44 Kevin Kerber @.***> wrote:

I appreciate you looking into it and getting back. It's something that would be nice to have, but isn't a deal-breaker or anything for me. Free free to close if you don't think you'll get to it. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/adiktofsugar/diff-package-lock/issues/43#issuecomment-1726370209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACH7L2WWKPU55JWLXVI7MDX3HYZHANCNFSM6AAAAAA45KQSDU . You are receiving this because you commented.Message ID: @.***>