Skip to content

Commit

Permalink
Update deps. Update READMe and contribution guide
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-k committed Nov 5, 2023
1 parent 71bdef6 commit 03c25e4
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 44 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
18 changes: 2 additions & 16 deletions docs/src/10-how-to-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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`.
4 changes: 2 additions & 2 deletions mig-client/mig-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -50,7 +50,7 @@ library
, http-client
, http-media
, http-types
, mig >=0.2
, mig >=0.2.0.1
, mtl
, text
default-language: GHC2021
4 changes: 2 additions & 2 deletions mig-client/package.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -28,7 +28,7 @@ dependencies:
- bytestring
- containers
- http-api-data
- mig >= 0.2
- mig >= 0.2.0.1
- http-client
- http-media
- mtl
Expand Down
4 changes: 2 additions & 2 deletions mig-extra/mig-extra.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mig-extra/package.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mig-rio/mig-rio.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions mig-rio/package.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -25,7 +25,7 @@ default-extensions:

dependencies:
- base >= 4.7 && < 5
- mig-server
- mig-server >= 0.1.0.1
- rio

ghc-options:
Expand Down
8 changes: 4 additions & 4 deletions mig-server/mig-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions mig-server/package.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mig-swagger-ui/mig-swagger-ui.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions mig-swagger-ui/package.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -35,7 +35,7 @@ dependencies:
- bytestring
- text
- lens
- mig >= 0.2
- mig >= 0.2.0.1
- file-embed-lzma
- blaze-html
- blaze-markup
Expand Down
4 changes: 2 additions & 2 deletions mig-wai/mig-wai.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -43,7 +43,7 @@ library
, containers
, data-default
, exceptions
, mig >=0.2
, mig >=0.2.0.1
, text
, wai
default-language: GHC2021
4 changes: 2 additions & 2 deletions mig-wai/package.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -31,7 +31,7 @@ dependencies:
- base >= 4.7 && < 5
- bytestring
- containers
- mig >= 0.2
- mig >= 0.2.0.1
- text
- wai
- exceptions
Expand Down

0 comments on commit 03c25e4

Please sign in to comment.