~jship/monad-logger-aeson

760166939dff5b46f4b619d6946b25c1427016f0 — Jason Shipman 1 year, 3 months ago e47864a
Support aeson-2.2 (#13)

M .github/workflows/ci.yaml => .github/workflows/ci.yaml +2 -1
@@ 13,7 13,8 @@ jobs:
      matrix:
        os: [ubuntu-latest, macOS-latest]
        resolver:
        - nightly # ghc-9.4.5
        - nightly # ghc-9.6.2
        - lts-21  # ghc-9.4.5
        - lts-20  # ghc-9.2.7
        - lts-19  # ghc-9.0.2
        - lts-18  # ghc-8.10.7

M monad-logger-aeson/library/Control/Monad/Logger/Aeson/Internal.hs => monad-logger-aeson/library/Control/Monad/Logger/Aeson/Internal.hs +14 -3
@@ 1,8 1,10 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}


@@ 50,9 52,8 @@ module Control.Monad.Logger.Aeson.Internal
  ) where

import Context (Store)
import Control.Applicative (Applicative(liftA2))
import Control.Monad.Logger (Loc(..), LogLevel(..), MonadLogger(..), ToLogStr(..), LogSource)
import Data.Aeson (KeyValue((.=)), Value(Object), (.:), (.:?), Encoding, FromJSON, ToJSON)
import Data.Aeson (KeyValue(..), Value(Object), (.:), (.:?), Encoding, FromJSON, ToJSON)
import Data.Aeson.Encoding.Internal (Series(..))
import Data.Aeson.Types (Pair, Parser)
import Data.String (IsString)


@@ 124,7 125,17 @@ newtype SeriesElem = UnsafeSeriesElem
  }

-- | @since 0.3.0.0
#if MIN_VERSION_aeson(2, 2, 0)
instance KeyValue Encoding SeriesElem where
  (.=) = explicitToField Aeson.toEncoding
  {-# INLINE (.=) #-}

  explicitToField f name value =
    UnsafeSeriesElem $ Aeson.pair name $ f value
  {-# INLINE explicitToField #-}
#else
deriving newtype instance KeyValue SeriesElem
#endif
-- | @since 0.3.1.0
deriving newtype instance Semigroup SeriesElem



@@ 179,7 190,7 @@ instance FromJSON LoggedMessage where
          <$> obj .: "file"
          <*> obj .: "package"
          <*> obj .: "module"
          <*> (liftA2 (,) (obj .: "line") (obj .: "char"))
          <*> (pure (,) <*> (obj .: "line") <*> (obj .: "char"))
          <*> pure (0, 0)

    parsePairs :: Maybe Value -> Parser (KeyMap Value)

M monad-logger-aeson/monad-logger-aeson.cabal => monad-logger-aeson/monad-logger-aeson.cabal +3 -3
@@ 41,7 41,7 @@ library
      library
  ghc-options: -Wall -fwarn-tabs -Wincomplete-uni-patterns -Wredundant-constraints
  build-depends:
      aeson >=1.5.2.0 && <2.1.3.0
      aeson >=1.5.2.0 && <2.3
    , base >=4.11.1.0 && <5
    , bytestring >=0.10.8.2 && <0.12.0.0
    , context >=0.2.0.0 && <0.3


@@ 61,7 61,7 @@ executable readme-example
      app
  ghc-options: -Wall -fwarn-tabs -Wincomplete-uni-patterns -Wredundant-constraints
  build-depends:
      aeson >=1.5.2.0 && <2.1.3.0
      aeson >=1.5.2.0 && <2.3
    , base >=4.11.1.0 && <5
    , monad-logger >=0.3.30 && <0.4.0
    , monad-logger-aeson


@@ 145,7 145,7 @@ test-suite monad-logger-aeson-test-suite
  build-tool-depends:
      hspec-discover:hspec-discover
  build-depends:
      aeson >=1.5.2.0 && <2.1.3.0
      aeson >=1.5.2.0 && <2.3
    , aeson-diff >=1.1.0.5 && <1.2.0.0
    , base >=4.11.1.0 && <5
    , bytestring >=0.10.8.2 && <0.12.0.0

M monad-logger-aeson/package.yaml => monad-logger-aeson/package.yaml +3 -3
@@ 29,7 29,7 @@ ghc-options:

library:
  dependencies:
  - aeson >=1.5.2.0 && <2.1.3.0
  - aeson >=1.5.2.0 && <2.3
  - base >=4.11.1.0 && <5
  - bytestring >=0.10.8.2 && <0.12.0.0
  - context >=0.2.0.0 && <0.3


@@ 48,7 48,7 @@ tests:
    build-tools:
    - hspec-discover
    dependencies:
    - aeson >=1.5.2.0 && <2.1.3.0
    - aeson >=1.5.2.0 && <2.3
    - aeson-diff >=1.1.0.5 && <1.2.0.0
    - base >=4.11.1.0 && <5
    - bytestring >=0.10.8.2 && <0.12.0.0


@@ 63,7 63,7 @@ executables:
    source-dirs: app
    main: readme-example.hs
    dependencies:
    - aeson >=1.5.2.0 && <2.1.3.0
    - aeson >=1.5.2.0 && <2.3
    - base >=4.11.1.0 && <5
    - monad-logger >=0.3.30 && <0.4.0
    - monad-logger-aeson

A stack/stack-lts-21.yaml => stack/stack-lts-21.yaml +3 -0
@@ 0,0 1,3 @@
resolver: lts-21.0
packages:
- ../monad-logger-aeson

A stack/stack-lts-21.yaml.lock => stack/stack-lts-21.yaml.lock +12 -0
@@ 0,0 1,12 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
#   https://docs.haskellstack.org/en/stable/lock_files

packages: []
snapshots:
- completed:
    sha256: 1867d84255dff8c87373f5dd03e5a5cb1c10a99587e26c8793e750c54e83ffdc
    size: 639139
    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/0.yaml
  original: lts-21.0

M stack/stack-nightly.yaml => stack/stack-nightly.yaml +12 -1
@@ 1,3 1,14 @@
resolver: nightly-2023-04-25
resolver: nightly-2023-06-30
packages:
- ../monad-logger-aeson
extra-deps:
# These are temporary to ensure we can build against aeson-2.2.
- aeson-2.2.0.0@sha256:deeab33f7f2a235c9e9ea76168f27a3669ad51bbdb363e830015352a3b2874ec,6217
- integer-conversion-0.1
- text-iso8601-0.1
# Remove after https://github.com/snoyberg/yaml/pull/220 is released.
- github: jgm/yaml
  commit: c41822ba7ccc2afd619a664b5026349b416bd2eb
  subdirs:
  - libyaml
  - yaml

M stack/stack-nightly.yaml.lock => stack/stack-nightly.yaml.lock +52 -5
@@ 3,10 3,57 @@
# For more information, please see the documentation at:
#   https://docs.haskellstack.org/en/stable/lock_files

packages: []
packages:
- completed:
    hackage: aeson-2.2.0.0@sha256:deeab33f7f2a235c9e9ea76168f27a3669ad51bbdb363e830015352a3b2874ec,6217
    pantry-tree:
      sha256: 2c65659ff9ab19047728c8cc2f20869ba7ca78a09fe03cecf826f5857f3d4c95
      size: 83036
  original:
    hackage: aeson-2.2.0.0@sha256:deeab33f7f2a235c9e9ea76168f27a3669ad51bbdb363e830015352a3b2874ec,6217
- completed:
    hackage: integer-conversion-0.1@sha256:9f77cc7711d3100a4483f2dd1a22f4be5b59d235a556d910d0e6c5e90a967551,2208
    pantry-tree:
      sha256: 17063e15091711b54f9a4a9ccb032f3c2ed68bb4ba097243333469ad8462b748
      size: 509
  original:
    hackage: integer-conversion-0.1
- completed:
    hackage: text-iso8601-0.1@sha256:fc10d8de72fc094d0d299644f17421b9430d1c1092a1355c7f0c02d8b6edf6a7,2371
    pantry-tree:
      sha256: f72aa62f5f4d1155b3d3f35e8227548a27cee83fb5d0742564b5ef26597f1431
      size: 427
  original:
    hackage: text-iso8601-0.1
- completed:
    name: libyaml
    pantry-tree:
      sha256: b46c46f4e960fbf89721c794072850751c2830d59b57e6da5425b100a1aa12a8
      size: 1257
    sha256: d8b59b6d8e231e4eb8c77607465b998b77cb7210df3b5d98afc2b12521c18240
    size: 98661
    subdir: libyaml
    url: https://github.com/jgm/yaml/archive/c41822ba7ccc2afd619a664b5026349b416bd2eb.tar.gz
    version: 0.1.3
  original:
    subdir: libyaml
    url: https://github.com/jgm/yaml/archive/c41822ba7ccc2afd619a664b5026349b416bd2eb.tar.gz
- completed:
    name: yaml
    pantry-tree:
      sha256: 59f03cfd74d72a5c77037cc34f7e0388e24539f58ab56b7eec96960f92aa7705
      size: 2206
    sha256: d8b59b6d8e231e4eb8c77607465b998b77cb7210df3b5d98afc2b12521c18240
    size: 98661
    subdir: yaml
    url: https://github.com/jgm/yaml/archive/c41822ba7ccc2afd619a664b5026349b416bd2eb.tar.gz
    version: 0.11.11.1
  original:
    subdir: yaml
    url: https://github.com/jgm/yaml/archive/c41822ba7ccc2afd619a664b5026349b416bd2eb.tar.gz
snapshots:
- completed:
    sha256: c110d42fae0aff8f393c87e2f52e70c50653554c4a6b942e401f464ea4c08a80
    size: 609034
    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2023/4/25.yaml
  original: nightly-2023-04-25
    sha256: fec3eb9ca6d240f95694cc0c4df065751fa93683314bfc25c6d1ba915ef56650
    size: 539330
    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2023/6/30.yaml
  original: nightly-2023-06-30