From b6e515a0a7abd0b3b387f7891d3680e979e3d74b Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Wed, 14 Apr 2021 22:43:40 +0200 Subject: [PATCH] Have Elm.Project.encode order the dependencies the same way the compiler does The Elm.Project.encode function previously did an alphabetical sort, which means that packages like "elm-community/*" would show up before "elm/*". The compiler, elm-json and elm-test-rs all on the other hand seem to sort by author then by package name, so "elm/*" shows up before "elm-community/*". This change makes it so that the author name is compared first, then the package name, to act like the compiler and the other tools. --- src/Elm/Project.elm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Elm/Project.elm b/src/Elm/Project.elm index e01a8e5..d3ef56e 100644 --- a/src/Elm/Project.elm +++ b/src/Elm/Project.elm @@ -144,7 +144,7 @@ encodeChunk (header, list) = encodeDeps : (constraint -> E.Value) -> Deps constraint -> E.Value encodeDeps encodeConstraint deps = - E.object <| List.sortBy Tuple.first <| + E.object <| List.sortBy (String.split "/" << Tuple.first) <| List.map (encodeDep encodeConstraint) deps