chore(server): break out Hasura.Base into own package

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8850
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 47310479d66adc3baf27ca9d2dbda7addea6bb3d
This commit is contained in:
Tom Harding 2023-04-21 15:24:45 +01:00 committed by hasura-bot
parent e768ef4920
commit 99c1d99ecb
6 changed files with 70 additions and 17 deletions

View File

@ -286,6 +286,7 @@ common lib-depends
, fast-logger
, free
, hashable
, hasura-base
, hasura-extras
, hasura-prelude
, http-client-tls
@ -506,9 +507,6 @@ library
, Hasura.App
, Hasura.Metadata.Class
, Hasura.Base.Error
, Hasura.Base.Instances
, Hasura.App.State
, Hasura.Backends.BigQuery.Connection
, Hasura.Backends.BigQuery.Execute

View File

@ -0,0 +1,68 @@
cabal-version: 3.6
name: hasura-base
version: 1.0.0
build-type: Simple
copyright: Hasura Inc.
library
hs-source-dirs: src
default-language: GHC2021
ghc-options:
-foptimal-applicative-do
-- This is just to keep compile-times in check and might be adjusted later (See mono #2610):
-fmax-simplifier-iterations=2
-- Taken from https://medium.com/mercury-bank/enable-all-the-warnings-a0517bc081c3
-Weverything
-Wno-missing-exported-signatures
-Wno-missing-import-lists
-Wno-missed-specialisations
-Wno-all-missed-specialisations
-Wno-unsafe
-Wno-safe
-Wno-missing-local-signatures
-Wno-monomorphism-restriction
-Wno-missing-kind-signatures
-Wno-missing-safe-haskell-mode
-- We want these warnings, but the code doesn't satisfy them yet:
-Wno-missing-deriving-strategies
-Wno-unused-packages
-Wno-deriving-typeable
-Wno-prepositive-qualified-module
-Wno-implicit-lift
-Wno-identities
-Wno-operator-whitespace
-Wno-partial-fields
-Wno-redundant-bang-patterns
-Wno-unused-type-patterns
build-depends:
, aeson
, arrows-extra
, autodocodec
, base
, cron
, hasura-prelude
, hasura-extras
, http-types
, kriti-lang
, lens
, openapi3
, pg-client
, regex-tdfa
, dependent-sum
, template-haskell
, text
, th-lift
, time
default-extensions:
BlockArguments
LambdaCase
NoImplicitPrelude
OverloadedStrings
PackageImports
exposed-modules:
Hasura.Base.Error
Hasura.Base.Instances

View File

@ -9,8 +9,6 @@ import Autodocodec qualified as AC
import Control.Monad.Fix
import Data.Aeson qualified as J
import Data.Fixed (Fixed (..))
import Data.Functor.Product (Product (Pair))
import "dependent-sum" Data.GADT.Compare (GCompare (gcompare), GOrdering (GEQ, GGT, GLT))
import Data.OpenApi.Declare as D
import Data.Text qualified as T
import Data.Time (NominalDiffTime)
@ -93,18 +91,6 @@ deriving instance TH.Lift Milliseconds
deriving instance TH.Lift Seconds
--------------------------------------------------------------------------------
-- GADT
instance (GCompare f, GCompare g) => GCompare (Product f g) where
Pair a1 a2 `gcompare` Pair b1 b2 = case gcompare a1 b1 of
GLT -> GLT
GEQ -> case gcompare a2 b2 of
GLT -> GLT
GEQ -> GEQ
GGT -> GGT
GGT -> GGT
--------------------------------------------------------------------------------
-- HasCodec

View File

@ -23,6 +23,7 @@ library
, graphql-engine
, graphql-parser
, haskell-src-meta
, hasura-base
, hasura-extras
, hasura-prelude
, hedgehog