From 2989047d7e9e159180104891c1ba0ed83060d4c7 Mon Sep 17 00:00:00 2001 From: gillchristian Date: Mon, 13 Jun 2022 13:36:59 +0200 Subject: [PATCH 1/4] Update readme.md --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c43eb35..8ad4a61 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,20 @@ If you are looking for a generator for Haskell client code, check out the [Haskell-OpenAPI-Client-Code-Generator](https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator) project. -## Building Tie +## Usage + +```bash +$ tie +Missing: FILE + +Usage: tie [-o|--output DIR] [--module-name MODULE] [--package-name PACKAGE] + [--extra-package PACKAGE] FILE + Generate a Haskell server from an OpenAPI3 specification +``` + +## Insallation + +### Building from source Below are the steps to install Tie using the Cabal build tool. @@ -40,7 +53,7 @@ $ cabal install . ## Community & Contact Feel free to join on us on our -[community Slack](https://tinyurl.com/scarf-community-slack) (#tie channel)! +[community Slack](https://tinyurl.com/scarf-community-slack) (`#tie` channel)! ## License From 291e7f7ccbb15a5dbfa06c3753e05e337cba6c1c Mon Sep 17 00:00:00 2001 From: gillchristian Date: Mon, 13 Jun 2022 13:37:38 +0200 Subject: [PATCH 2/4] Sync default.nix with tie.cabal Using cabal2nix --- default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index f09d297..99d403d 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,6 @@ { mkDerivation, aeson, base, bytestring, containers, directory -, filepath, hspec, insert-ordered-containers, lens, lib, mtl -, openapi3, optparse-applicative, prettyprinter, relude, tasty +, filepath, hspec, http-media, insert-ordered-containers, lens, lib +, mtl, openapi3, optparse-applicative, prettyprinter, relude, tasty , tasty-discover, tasty-golden, tasty-hspec, tasty-hunit, text , unordered-containers, yaml }: @@ -12,7 +12,7 @@ mkDerivation { isExecutable = true; enableSeparateDataOutput = true; libraryHaskellDepends = [ - aeson base bytestring containers directory filepath + aeson base bytestring containers directory filepath http-media insert-ordered-containers lens mtl openapi3 prettyprinter relude text unordered-containers yaml ]; @@ -23,6 +23,6 @@ mkDerivation { tasty-golden tasty-hspec tasty-hunit text yaml ]; testToolDepends = [ tasty-discover ]; - license = "unknown"; - hydraPlatforms = lib.platforms.none; + description = "Tie allows generation of Haskell server stubs from OpenAPI (v 3.x) specifications."; + license = lib.licenses.asl20; } From 728ecd13b92f29c6b4b37526b24824912b3b1170 Mon Sep 17 00:00:00 2001 From: gillchristian Date: Mon, 13 Jun 2022 14:07:14 +0200 Subject: [PATCH 3/4] Add logo --- README.md | 4 ++++ assets/tie.svg | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 assets/tie.svg diff --git a/README.md b/README.md index 8ad4a61..0e3724e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +
+ +
+

Tie

Tie allows generation of Haskell server stubs from diff --git a/assets/tie.svg b/assets/tie.svg new file mode 100644 index 0000000..84ec155 --- /dev/null +++ b/assets/tie.svg @@ -0,0 +1,6 @@ + + + + + + From bd46e7282a3bb943a28a8c44052be4b993b90162 Mon Sep 17 00:00:00 2001 From: gillchristian Date: Mon, 13 Jun 2022 14:31:33 +0200 Subject: [PATCH 4/4] Update CLI help --- README.md | 18 +++++++++++++++--- bin/Main.hs | 5 +++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0e3724e..803b550 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,25 @@ project. ## Usage -```bash -$ tie -Missing: FILE +``` +$ tie --help +tie - openapi3 server code generator Usage: tie [-o|--output DIR] [--module-name MODULE] [--package-name PACKAGE] [--extra-package PACKAGE] FILE + Generate a Haskell server from an OpenAPI3 specification + +Available options: + -o,--output DIR The directory output (default: "out") + --module-name MODULE Name of the generated top level module + (default: "OpenAPI") + --package-name PACKAGE Name of the generated cabal project + (default: "open-api") + --extra-package PACKAGE Extra packages to include in the generated cabal + project + FILE OpenAPI specification file + -h,--help Show this help text ``` ## Insallation diff --git a/bin/Main.hs b/bin/Main.hs index 628eb33..8306850 100644 --- a/bin/Main.hs +++ b/bin/Main.hs @@ -47,6 +47,7 @@ options = <> metavar "DIR" <> showDefault <> value "out" + <> help "The directory output" ) <*> option str @@ -54,6 +55,7 @@ options = <> metavar "MODULE" <> showDefault <> value "OpenAPI" + <> help "Name of the generated top level module" ) <*> option str @@ -61,16 +63,19 @@ options = <> metavar "PACKAGE" <> showDefault <> value "open-api" + <> help "Name of the generated cabal project" ) <*> many ( option str ( long "extra-package" <> metavar "PACKAGE" + <> help "Extra packages to include in the generated cabal project" ) ) <*> strArgument ( metavar "FILE" + <> help "OpenAPI specification file" ) main :: IO ()