sort-package-deps
v1.44.0
Published
Script to rewrite package.json dependencies in alphabetical order. Useful for pnpm or @microsoft/rush.
Downloads
123
Maintainers
Readme
sort-dependencies
npx sort-dependencies <path-to-package-dir-or-package.json> --apply
Why
Some toolchains like @microsoft/rush or pnpm make changes to package.json
dependencies without keeping the alphabetical order. This can also happen when doing manual changes of course.
The problem arises when tools like pnpm publish
in combination with rush then sort the dependencies alphabetically but don't commit it back leaving a dirty repo which causes pnpm
to abort publishing.
sort-dependencies
is thus useful in
I also could somehow not find another package that did this the way I liked. prettier-package-json was close but did way more and also reordered the the root properties themselves which I did not like.