From 190d70220076296a2ee1e01a4b8705468be69218 Mon Sep 17 00:00:00 2001 From: Tom Sydney Kerckhove Date: Mon, 1 Nov 2021 19:06:42 +0100 Subject: [PATCH] split off a autodocodec-aeson-schema package --- autodocodec-aeson-schema/.gitignore | 2 + autodocodec-aeson-schema/LICENSE | 21 +++++++++ .../autodocodec-aeson-schema.cabal | 43 +++++++++++++++++++ autodocodec-aeson-schema/package.yaml | 27 ++++++++++++ .../src/Autodocodec/Aeson/Document.hs | 0 autodocodec-aeson/autodocodec-aeson.cabal | 1 - autodocodec-aeson/src/Autodocodec/Aeson.hs | 2 - .../autodocodec-api-usage.cabal | 2 + autodocodec-api-usage/package.yaml | 2 + .../test/Autodocodec/Aeson/DocumentSpec.hs | 1 + autodocodec-yaml/autodocodec-yaml.cabal | 2 +- autodocodec-yaml/package.yaml | 2 +- .../src/Autodocodec/Yaml/Document.hs | 2 +- nix/overlay.nix | 1 + stack.yaml | 1 + 15 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 autodocodec-aeson-schema/.gitignore create mode 100644 autodocodec-aeson-schema/LICENSE create mode 100644 autodocodec-aeson-schema/autodocodec-aeson-schema.cabal create mode 100644 autodocodec-aeson-schema/package.yaml rename {autodocodec-aeson => autodocodec-aeson-schema}/src/Autodocodec/Aeson/Document.hs (100%) diff --git a/autodocodec-aeson-schema/.gitignore b/autodocodec-aeson-schema/.gitignore new file mode 100644 index 0000000..c368d45 --- /dev/null +++ b/autodocodec-aeson-schema/.gitignore @@ -0,0 +1,2 @@ +.stack-work/ +*~ \ No newline at end of file diff --git a/autodocodec-aeson-schema/LICENSE b/autodocodec-aeson-schema/LICENSE new file mode 100644 index 0000000..b762003 --- /dev/null +++ b/autodocodec-aeson-schema/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Tom Sydney Kerckhove + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/autodocodec-aeson-schema/autodocodec-aeson-schema.cabal b/autodocodec-aeson-schema/autodocodec-aeson-schema.cabal new file mode 100644 index 0000000..0192bf6 --- /dev/null +++ b/autodocodec-aeson-schema/autodocodec-aeson-schema.cabal @@ -0,0 +1,43 @@ +cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.34.4. +-- +-- see: https://github.com/sol/hpack + +name: autodocodec-aeson-schema +version: 0.0.0.0 +synopsis: Autodocodec JSON Schemas +homepage: https://github.com/NorfairKing/autodocodec#readme +bug-reports: https://github.com/NorfairKing/autodocodec/issues +author: Tom Sydney Kerckhove +maintainer: syd@cs-syd.eu +copyright: 2021 Tom Sydney Kerckhove +license: MIT +license-file: LICENSE +build-type: Simple + +source-repository head + type: git + location: https://github.com/NorfairKing/autodocodec + +library + exposed-modules: + Autodocodec.Aeson.Document + other-modules: + Paths_autodocodec_aeson_schema + hs-source-dirs: + src + build-depends: + aeson + , autodocodec + , autodocodec-aeson + , base >=4.7 && <5 + , containers + , mtl + , text + , unordered-containers + , validity + , validity-aeson + , validity-containers + , validity-text + default-language: Haskell2010 diff --git a/autodocodec-aeson-schema/package.yaml b/autodocodec-aeson-schema/package.yaml new file mode 100644 index 0000000..6a19369 --- /dev/null +++ b/autodocodec-aeson-schema/package.yaml @@ -0,0 +1,27 @@ +name: autodocodec-aeson-schema +version: 0.0.0.0 +github: "NorfairKing/autodocodec" +license: MIT +license-file: LICENSE +author: "Tom Sydney Kerckhove" +maintainer: "syd@cs-syd.eu" +copyright: "2021 Tom Sydney Kerckhove" +synopsis: Autodocodec JSON Schemas + +dependencies: +- base >= 4.7 && < 5 + +library: + source-dirs: src + dependencies: + - aeson + - autodocodec + - autodocodec-aeson + - containers + - mtl + - text + - unordered-containers + - validity + - validity-aeson + - validity-containers + - validity-text diff --git a/autodocodec-aeson/src/Autodocodec/Aeson/Document.hs b/autodocodec-aeson-schema/src/Autodocodec/Aeson/Document.hs similarity index 100% rename from autodocodec-aeson/src/Autodocodec/Aeson/Document.hs rename to autodocodec-aeson-schema/src/Autodocodec/Aeson/Document.hs diff --git a/autodocodec-aeson/autodocodec-aeson.cabal b/autodocodec-aeson/autodocodec-aeson.cabal index b3d3eea..2420fc2 100644 --- a/autodocodec-aeson/autodocodec-aeson.cabal +++ b/autodocodec-aeson/autodocodec-aeson.cabal @@ -25,7 +25,6 @@ library Autodocodec.Aeson Autodocodec.Aeson.Decode Autodocodec.Aeson.DerivingVia - Autodocodec.Aeson.Document Autodocodec.Aeson.Encode other-modules: Paths_autodocodec_aeson diff --git a/autodocodec-aeson/src/Autodocodec/Aeson.hs b/autodocodec-aeson/src/Autodocodec/Aeson.hs index 45f0173..3ff225b 100644 --- a/autodocodec-aeson/src/Autodocodec/Aeson.hs +++ b/autodocodec-aeson/src/Autodocodec/Aeson.hs @@ -4,12 +4,10 @@ module Autodocodec.Aeson ( -- * To makes sure we definitely export everything. module Autodocodec.Aeson.Decode, module Autodocodec.Aeson.DerivingVia, - module Autodocodec.Aeson.Document, module Autodocodec.Aeson.Encode, ) where import Autodocodec.Aeson.Decode import Autodocodec.Aeson.DerivingVia () -import Autodocodec.Aeson.Document import Autodocodec.Aeson.Encode diff --git a/autodocodec-api-usage/autodocodec-api-usage.cabal b/autodocodec-api-usage/autodocodec-api-usage.cabal index db474ff..42796da 100644 --- a/autodocodec-api-usage/autodocodec-api-usage.cabal +++ b/autodocodec-api-usage/autodocodec-api-usage.cabal @@ -32,6 +32,7 @@ library , aeson , autodocodec , autodocodec-aeson + , autodocodec-aeson-schema , autodocodec-yaml , base >=4.7 && <5 , bytestring @@ -61,6 +62,7 @@ test-suite autodocodec-api-usage-test , aeson , autodocodec , autodocodec-aeson + , autodocodec-aeson-schema , autodocodec-api-usage , autodocodec-yaml , base >=4.7 && <5 diff --git a/autodocodec-api-usage/package.yaml b/autodocodec-api-usage/package.yaml index a13ce9e..2a2f788 100644 --- a/autodocodec-api-usage/package.yaml +++ b/autodocodec-api-usage/package.yaml @@ -18,6 +18,7 @@ library: - aeson - autodocodec - autodocodec-aeson + - autodocodec-aeson-schema - autodocodec-yaml - bytestring - genvalidity @@ -43,6 +44,7 @@ tests: - aeson - autodocodec - autodocodec-aeson + - autodocodec-aeson-schema - autodocodec-api-usage - autodocodec-yaml - bytestring diff --git a/autodocodec-api-usage/test/Autodocodec/Aeson/DocumentSpec.hs b/autodocodec-api-usage/test/Autodocodec/Aeson/DocumentSpec.hs index 7e78ff1..a433183 100644 --- a/autodocodec-api-usage/test/Autodocodec/Aeson/DocumentSpec.hs +++ b/autodocodec-api-usage/test/Autodocodec/Aeson/DocumentSpec.hs @@ -9,6 +9,7 @@ module Autodocodec.Aeson.DocumentSpec (spec) where import Autodocodec import Autodocodec.Aeson +import Autodocodec.Aeson.Document import Autodocodec.Usage import qualified Data.Aeson as JSON import Data.Data diff --git a/autodocodec-yaml/autodocodec-yaml.cabal b/autodocodec-yaml/autodocodec-yaml.cabal index 6608b4c..e085e15 100644 --- a/autodocodec-yaml/autodocodec-yaml.cabal +++ b/autodocodec-yaml/autodocodec-yaml.cabal @@ -30,7 +30,7 @@ library src build-depends: autodocodec - , autodocodec-aeson + , autodocodec-aeson-schema , base >=4.7 && <5 , bytestring , containers diff --git a/autodocodec-yaml/package.yaml b/autodocodec-yaml/package.yaml index 3e7c6de..a35f81e 100644 --- a/autodocodec-yaml/package.yaml +++ b/autodocodec-yaml/package.yaml @@ -15,7 +15,7 @@ library: source-dirs: src dependencies: - autodocodec - - autodocodec-aeson + - autodocodec-aeson-schema - bytestring - containers - safe-coloured-text diff --git a/autodocodec-yaml/src/Autodocodec/Yaml/Document.hs b/autodocodec-yaml/src/Autodocodec/Yaml/Document.hs index 34df56a..d37d37c 100644 --- a/autodocodec-yaml/src/Autodocodec/Yaml/Document.hs +++ b/autodocodec-yaml/src/Autodocodec/Yaml/Document.hs @@ -7,7 +7,7 @@ module Autodocodec.Yaml.Document where import Autodocodec -import Autodocodec.Aeson +import Autodocodec.Aeson.Document import Data.ByteString (ByteString) import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.Map as M diff --git a/nix/overlay.nix b/nix/overlay.nix index 41b4245..185c361 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -10,6 +10,7 @@ with final.haskell.lib; final.lib.genAttrs [ "autodocodec" "autodocodec-aeson" + "autodocodec-aeson-schema" "autodocodec-yaml" "autodocodec-api-usage" ] diff --git a/stack.yaml b/stack.yaml index 971ee00..05994f4 100644 --- a/stack.yaml +++ b/stack.yaml @@ -2,6 +2,7 @@ resolver: nightly-2021-05-10 packages: - autodocodec - autodocodec-aeson +- autodocodec-aeson-schema - autodocodec-yaml # Test-only - autodocodec-api-usage