packages feed

hercules-ci-cli 0.2.5 → 0.2.6

raw patch · 3 files changed

+11/−4 lines, 3 files

Files

CHANGELOG.md view
@@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.2.6 - 2022-03-09++### Added++ - Haskell `aeson` 2.0 support+ ## 0.2.5 - 2022-03-07  ### Added
hercules-ci-cli.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12  name:           hercules-ci-cli-version:        0.2.5+version:        0.2.6 synopsis:       The hci command for working with Hercules CI homepage:       https://docs.hercules-ci.com bug-reports:    https://github.com/hercules-ci/hercules-ci-agent/issues
src/Hercules/CLI/JSON.hs view
@@ -7,9 +7,10 @@ import Data.Aeson import Data.Aeson.Encode.Pretty (Indent (Spaces), confIndent, confTrailingNewline, defConfig, encodePretty') import qualified Data.Aeson.Encode.Pretty+import qualified Data.Aeson.Key as AK+import qualified Data.Aeson.KeyMap as AK import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BL-import qualified Data.HashMap.Strict as HM import qualified Data.List.NonEmpty as NEL import qualified Data.Text as T import Hercules.CLI.Exception (UserException (UserException))@@ -32,7 +33,7 @@         & NEL.groupAllWith (NEL.head . fst)         & traverse           ( \(groupItem@(child :| _, _) :| groupItems) ->-              (child .=)+              (AK.fromText child .=)                 <$> mergeLeafPaths (context ++ [child]) (map (first NEL.tail) (groupItem : groupItems))           )         <&> object@@ -45,7 +46,7 @@ toLeafPaths = concatMap \(path, item) ->   case item of     Object fields ->-      fields & HM.toList & concatMap \(subpath, subitem) ->+      fields & AK.toAscList & fmap (first AK.toText) & concatMap \(subpath, subitem) ->         toLeafPaths [(path ++ [subpath], subitem)]     _ -> [(path, item)]