From 03c25e4c29b6baf87fea28ccfd44f89ae635b4e8 Mon Sep 17 00:00:00 2001 From: Anton Kholomiov Date: Sun, 5 Nov 2023 10:13:21 +0300 Subject: [PATCH] Update deps. Update READMe and contribution guide --- README.md | 22 ++++++++++++++++++++++ docs/src/10-how-to-contribute.md | 18 ++---------------- mig-client/mig-client.cabal | 4 ++-- mig-client/package.yaml | 4 ++-- mig-extra/mig-extra.cabal | 4 ++-- mig-extra/package.yaml | 4 ++-- mig-rio/mig-rio.cabal | 4 ++-- mig-rio/package.yaml | 4 ++-- mig-server/mig-server.cabal | 8 ++++---- mig-server/package.yaml | 8 ++++---- mig-swagger-ui/mig-swagger-ui.cabal | 4 ++-- mig-swagger-ui/package.yaml | 4 ++-- mig-wai/mig-wai.cabal | 4 ++-- mig-wai/package.yaml | 4 ++-- 14 files changed, 52 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 097354a..d85f850 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,25 @@ The name `mig` (pronounced as meeg) is a russian word for "instant moment". * Quick start guide: [tutorial](https://anton-k.github.io/mig/) * Summary of the main functions: [refs](https://anton-k.github.io/mig/09-reference.html) * How to contribute: [guide](https://anton-k.github.io/mig/10-how-to-contribute.html) + +### Structure of the repo + +An overview of the mig repo: + +* `mig` - core library. It defines DSL and low-level represenatation for API and server as a function + +* `mig-wai` - conversion of mig servers to WAI applications + +* `mig-extra` - extra utils for core library + +* `mig-swagger-ui` - swagger servers for mig servers. Offers nice in the browser UI to test HTTP REST applications + +* `mig-server` - mig servers based on warp with batteries included + +* `mig-rio` - binding to rio library. It comtains instance of the `HasServer` class for RIO type. + +* `examples` - several examples of servers and clients. Examples can be run with commands in the [`Makefile`](https://github.com/anton-k/mig/blob/main/examples/mig-example-apps/Makefile) of their subdirectory. + +* `docs` - tutorial for the library and reference of the main functions. It is build with `mdbook` and deployed on github pages. + +See [`Makefile`](https://github.com/anton-k/mig/blob/main/Makefile) for main commands to work with repo in dev mode. diff --git a/docs/src/10-how-to-contribute.md b/docs/src/10-how-to-contribute.md index f3451d7..cf762e1 100644 --- a/docs/src/10-how-to-contribute.md +++ b/docs/src/10-how-to-contribute.md @@ -8,6 +8,7 @@ Also there is a CI which checks for: * build and test of all libraries with stack * build and test of all examples in the directory `examples` with stack * `fourmolu` formatting +* deploy of docs/tutorial to github pages (on push to main branch) ## how to automate formatter check @@ -28,18 +29,6 @@ else echo "fourmolu cannot be found" echo "install fourmolu via cabal install" fi - -if command -v cabal-fmt &> /dev/null -then - files=$(git diff --staged --diff-filter=ACMR --name-only -- '*.cabal') - for file in $files - do - cabal-fmt --inplace --no-tabular $file - git add $file - done -else - echo "cabal-fmt cannot be found" -fi ``` Save this as file `.git/hooks/pre-commit` in your repo @@ -49,10 +38,7 @@ and make it executable: chmod +x .git/hooks/pre-commit ``` -The script requires two executables which both can be installed from Hackage: - -* `fourmolu` -* `cabal-fmt` +The script requires `fourmolu` executable which both can be installed from Hackage. After that all files that you modify will be formatted properly. Formatting settings are in the file `fourmolu.yaml`. diff --git a/mig-client/mig-client.cabal b/mig-client/mig-client.cabal index e9302ac..afb58eb 100644 --- a/mig-client/mig-client.cabal +++ b/mig-client/mig-client.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: mig-client -version: 0.1.0.0 +version: 0.1.0.1 synopsis: Build http-clients from API definition for mig servers description: With this library we can build client functions for HTTP-applications from the same code as server definition. @@ -50,7 +50,7 @@ library , http-client , http-media , http-types - , mig >=0.2 + , mig >=0.2.0.1 , mtl , text default-language: GHC2021 diff --git a/mig-client/package.yaml b/mig-client/package.yaml index 2807cb9..858751f 100644 --- a/mig-client/package.yaml +++ b/mig-client/package.yaml @@ -1,5 +1,5 @@ name: mig-client -version: 0.1.0.0 +version: 0.1.0.1 github: "anton-k/mig" license: BSD3 author: "Anton Kholomiov" @@ -28,7 +28,7 @@ dependencies: - bytestring - containers - http-api-data -- mig >= 0.2 +- mig >= 0.2.0.1 - http-client - http-media - mtl diff --git a/mig-extra/mig-extra.cabal b/mig-extra/mig-extra.cabal index 23e3e05..9590683 100644 --- a/mig-extra/mig-extra.cabal +++ b/mig-extra/mig-extra.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: mig-extra -version: 0.1.0.0 +version: 0.1.0.1 synopsis: Extra utils for Mig core library description: Extra utils for mig server library category: Web @@ -62,7 +62,7 @@ library , http-api-data , http-media , http-types - , mig >=0.2 + , mig >=0.2.0.1 , mig-client , openapi3 , template-haskell diff --git a/mig-extra/package.yaml b/mig-extra/package.yaml index 1daceee..27aab74 100644 --- a/mig-extra/package.yaml +++ b/mig-extra/package.yaml @@ -1,5 +1,5 @@ name: mig-extra -version: 0.1.0.0 +version: 0.1.0.1 github: "anton-k/mig" license: BSD3 author: "Anton Kholomiov" @@ -33,7 +33,7 @@ default-extensions: dependencies: - base >= 4.7 && < 5 - data-default -- mig >= 0.2 +- mig >= 0.2.0.1 - http-api-data - blaze-html - http-types diff --git a/mig-rio/mig-rio.cabal b/mig-rio/mig-rio.cabal index 7191b23..4ac0462 100644 --- a/mig-rio/mig-rio.cabal +++ b/mig-rio/mig-rio.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: mig-rio -version: 0.1.0.0 +version: 0.1.0.1 synopsis: Utils to use RIO with mig library description: Utils to use mig with rio library category: Web @@ -35,6 +35,6 @@ library ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wunused-packages build-depends: base >=4.7 && <5 - , mig-server + , mig-server >=0.1.0.1 , rio default-language: GHC2021 diff --git a/mig-rio/package.yaml b/mig-rio/package.yaml index 00345d8..42783c0 100644 --- a/mig-rio/package.yaml +++ b/mig-rio/package.yaml @@ -1,5 +1,5 @@ name: mig-rio -version: 0.1.0.0 +version: 0.1.0.1 github: "anton-k/mig" license: BSD3 author: "Anton Kholomiov" @@ -25,7 +25,7 @@ default-extensions: dependencies: - base >= 4.7 && < 5 -- mig-server +- mig-server >= 0.1.0.1 - rio ghc-options: diff --git a/mig-server/mig-server.cabal b/mig-server/mig-server.cabal index 66f3094..6bd36b1 100644 --- a/mig-server/mig-server.cabal +++ b/mig-server/mig-server.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: mig-server -version: 0.1.0.0 +version: 0.1.0.1 synopsis: Build lightweight and composable servers description: With library mig we can build lightweight and composable servers. There are only couple of combinators to assemble servers from parts. @@ -103,10 +103,10 @@ library , data-default , http-api-data , http-types - , mig >=0.2 - , mig-extra >=0.1 + , mig >=0.2.0.1 + , mig-extra >=0.1.0.1 , mig-swagger-ui >=0.1 - , mig-wai >=0.1 + , mig-wai >=0.1.0.1 , openapi3 , text , transformers diff --git a/mig-server/package.yaml b/mig-server/package.yaml index 27a139f..0806d0d 100644 --- a/mig-server/package.yaml +++ b/mig-server/package.yaml @@ -1,5 +1,5 @@ name: mig-server -version: 0.1.0.0 +version: 0.1.0.1 github: "anton-k/mig" license: BSD3 author: "Anton Kholomiov" @@ -84,9 +84,9 @@ default-extensions: dependencies: - aeson - base >= 4.7 && < 5 -- mig >= 0.2 -- mig-extra >= 0.1 -- mig-wai >= 0.1 +- mig >= 0.2.0.1 +- mig-extra >= 0.1.0.1 +- mig-wai >= 0.1.0.1 - http-types - text - http-api-data diff --git a/mig-swagger-ui/mig-swagger-ui.cabal b/mig-swagger-ui/mig-swagger-ui.cabal index 690ecc1..c9325ba 100644 --- a/mig-swagger-ui/mig-swagger-ui.cabal +++ b/mig-swagger-ui/mig-swagger-ui.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: mig-swagger-ui -version: 0.1.0.0 +version: 0.1.0.1 synopsis: Swagger servers for mig library description: Appends swagger servers for mig servers. Example of the usage. This code adds swagger server which is serverd on path "swagger-ui" to our server @@ -69,7 +69,7 @@ library , file-embed-lzma , http-api-data , lens - , mig >=0.2 + , mig >=0.2.0.1 , openapi3 , text default-language: GHC2021 diff --git a/mig-swagger-ui/package.yaml b/mig-swagger-ui/package.yaml index 8eae8a1..56c43ee 100644 --- a/mig-swagger-ui/package.yaml +++ b/mig-swagger-ui/package.yaml @@ -1,5 +1,5 @@ name: mig-swagger-ui -version: 0.1.0.0 +version: 0.1.0.1 github: "anton-k/mig" license: BSD3 author: "Anton Kholomiov" @@ -35,7 +35,7 @@ dependencies: - bytestring - text - lens -- mig >= 0.2 +- mig >= 0.2.0.1 - file-embed-lzma - blaze-html - blaze-markup diff --git a/mig-wai/mig-wai.cabal b/mig-wai/mig-wai.cabal index 0b4fd6c..785ec39 100644 --- a/mig-wai/mig-wai.cabal +++ b/mig-wai/mig-wai.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: mig-wai -version: 0.1.0.0 +version: 0.1.0.1 synopsis: Render mig-servers as wai-applications description: Library to render mig-servers as WAI-applications. category: Web @@ -43,7 +43,7 @@ library , containers , data-default , exceptions - , mig >=0.2 + , mig >=0.2.0.1 , text , wai default-language: GHC2021 diff --git a/mig-wai/package.yaml b/mig-wai/package.yaml index 5dd3371..29739e7 100644 --- a/mig-wai/package.yaml +++ b/mig-wai/package.yaml @@ -1,5 +1,5 @@ name: mig-wai -version: 0.1.0.0 +version: 0.1.0.1 github: "anton-k/mig" license: BSD3 author: "Anton Kholomiov" @@ -31,7 +31,7 @@ dependencies: - base >= 4.7 && < 5 - bytestring - containers -- mig >= 0.2 +- mig >= 0.2.0.1 - text - wai - exceptions