summoner-tui 2.0.0.0 → 2.0.1.0
raw patch · 4 files changed
+208/−93 lines, 4 filesdep +colouristadep −filepathdep ~basedep ~brickdep ~reludePVP ok
version bump matches the API change (PVP)
Dependencies added: colourista
Dependencies removed: filepath
Dependency ranges changed: base, brick, relude, validation-selective
API changes (from Hackage documentation)
Files
- CHANGELOG.md +19/−1
- README.md +179/−85
- src/Summoner/Tui.hs +1/−1
- summoner-tui.cabal +9/−6
CHANGELOG.md view
@@ -3,7 +3,25 @@ `summoner` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. -## 2.0.0.0 – Mar 28, 2019+## 2.0.1.0 — May 21, 2020++* [#443](https://github.com/kowainik/summoner/issues/443):+ Support GHC-8.10.1 for `Summoner` project.+* [#459](https://github.com/kowainik/summoner/issues/459):+ Bump up `tomland` version to `1.3.0.0`.+* [#460](https://github.com/kowainik/summoner/issues/460):+ Bump up `relude` version to `0.7.0.0`.+ Remove `Summoner.Template.Mempty` as `memptyIfFalse` is imported from+ `Relude`.+* [#455](https://github.com/kowainik/summoner/issues/455):+ Allow `validation-selective` version `0.1.0.0`.+* [#452](https://github.com/kowainik/summoner/issues/452):+ Bump up `colourista` version to `0.1.0.0`. Remove the+ `Summoner.Ansi` module.+* __#TUI__ Bump up `brick` upper bound to allow `0.53`.+* __#CLI__ Bump up `time` upper bound to allow `1.10`.++## 2.0.0.0 – Mar 28, 2020 * [#246](https://github.com/kowainik/summoner/issues/246): Put common fields into the `common-options` [common stanza](https://vrom911.github.io/blog/common-stanzas).
README.md view
@@ -23,51 +23,59 @@ ## Structure -* [Demo](#demo-)- + [TUI demo](#tui-demo-)- + [CLI demo](#cli-demo-)- + [Examples](#examples-)-* [Features](#features-)-* [Get started](#get-started-)- + [Prerequisites](#prerequisites-)- + [Installation](#installation-)- + [Summon-TUI](#summon-tui-)- + [TUI: download binary](#tui-download-binary-)- + [TUI: Homebrew](#tui-homebrew-)- + [TUI: Ubuntu](#tui-ubuntu-)- + [TUI: from Hackage/Stackage](#tui-from-hackagestackage-)- + [TUI: from source](#tui-from-source-)- + [Summon-CLI](#summon-cli-)- + [CLI: download binary](#cli-download-binary-)- + [CLI: Homebrew](#cli-homebrew-)- + [CLI: Ubuntu](#cli-ubuntu-)- + [CLI: from Hackage/Stackage](#cli-from-hackagestackage-)- + [CLI: from source](#cli-from-source-)- + [Setup](#setup-)-* [Usage](#usage-)- + [Command-line arguments](#command-line-arguments-)- + [File configuration](#file-configuration-)- + [TUI](#tui-)- + [CLI](#cli-)-* [FAQ](#faq-)-* [For Developers](#for-developers-)- + [Build](#build-)- + [Test](#test-)- + [Run](#run-)-* [Acknowledgments](#acknowledgments-)+* [Demo](#demo)+ + [TUI demo](#tui-demo)+ + [CLI demo](#cli-demo)+ + [Examples](#examples)+* [Features](#features)+* [Get started](#get-started)+ + [Prerequisites](#prerequisites)+ + [Installation](#installation)+ + [Summon-TUI](#summon-tui)+ + [TUI: download binary](#tui-download-binary)+ + [TUI: Homebrew](#tui-homebrew)+ + [TUI: Ubuntu](#tui-ubuntu)+ + [TUI: from Hackage/Stackage](#tui-from-hackagestackage)+ + [TUI: from source](#tui-from-source)+ + [Summon-CLI](#summon-cli)+ + [CLI: download binary](#cli-download-binary)+ + [CLI: Homebrew](#cli-homebrew)+ + [CLI: Ubuntu](#cli-ubuntu)+ + [CLI: from Hackage/Stackage](#cli-from-hackagestackage)+ + [CLI: from source](#cli-from-source)+ + [Setup](#setup)+* [Usage](#usage)+ + [Command-line arguments](#command-line-arguments)+ + [File configuration](#file-configuration)+ + [TUI](#tui)+ + [CLI](#cli)+* [FAQ](#faq)+* [For Developers](#for-developers)+ + [Build](#build)+ + [Test](#test)+ + [Run](#run)+* [Acknowledgments](#acknowledgments) -## Demo [↑](#structure)+## Demo -### TUI demo [↑](#structure)+[[Back to the Table of Contents] ↑](#structure) +### TUI demo++[[Back to the Table of Contents] ↑](#structure)+ [](https://asciinema.org/a/314375) -### CLI demo [↑](#structure)+### CLI demo +[[Back to the Table of Contents] ↑](#structure)+ [](https://asciinema.org/a/314374) ### Examples +[[Back to the Table of Contents] ↑](#structure)+ You can also see complete examples in the following folder: * [`summon-cli/examples/`: Examples of scaffolded projects](https://github.com/kowainik/summoner/tree/master/summoner-cli/examples/)@@ -85,16 +93,20 @@ All batteries-included project which supports both build tools and shows every Summoner feature. -## Features [↑](#structure)+## Features +[[Back to the Table of Contents] ↑](#structure)+ Summoner is a tool that combines predefined configurations, command-line arguments and a chosen interface. To fully understand the power in your hands with the help of Summoner, please read this section. Below you can see highlighted features in different categories. -### Project [↑](#structure)+### Project +[[Back to the Table of Contents] ↑](#structure)+ Features related to the structure and content of the generated projects. + Support for Cabal and Stack build tools.@@ -133,8 +145,10 @@ -with-rtsopts=-N ``` -### GitHub [↑](#structure)+### GitHub +[[Back to the Table of Contents] ↑](#structure)+ + Initialisation of the git repository inside the project folder. + Initial commit creation. + Uploading the repository to GitHub.@@ -144,8 +158,10 @@ + Ability to include your custom GitHub meta files: `CONTRIBUTING.md`, `CODEOWNERS`, `.github/pull_request_template.md`, etc. + Guessing user credentials from the local `.gitconfig` file. -### CI [↑](#structure)+### CI +[[Back to the Table of Contents] ↑](#structure)+ + Generation of the `.travis.yml` file that runs build and tests on CI under Linux using [Dead simple Haskell Travis Settings for Cabal and Stack](https://chshersh.github.io/posts/2019-02-25-haskell-travis). + Generation of the `appveyor.yaml` file which runs build and tests on CI under Windows.@@ -155,16 +171,20 @@ + `-Werror` is enabled on CI not to miss any warnings. + Run HLint checks on CI. -### Others [↑](#structure)+### Others +[[Back to the Table of Contents] ↑](#structure)+ + Carefully collected Haskell project best practices gathered in your projects' scaffold. + Generate beginner-friendly default configuration using the `summon config` command. + Ability to create a project in the offline mode. + Ability to check GHC-specific versions of the corresponding `base` library and Stackage snapshot resolver via `summon show ghc` command. -### Project structure example [↑](#structure)+### Project structure example +[[Back to the Table of Contents] ↑](#structure)+ This is an example of the project hierarchy you can get if you are running Summoner's `new` command with all options enabled: ```@@ -193,10 +213,14 @@ └── .travis.yml ``` -## Get started [↑](#structure)+## Get started -### Prerequisites [↑](#structure)+[[Back to the Table of Contents] ↑](#structure) +### Prerequisites++[[Back to the Table of Contents] ↑](#structure)+ To start using Summoner make sure that you have the following tools installed on your machine: * [`git`](https://git-scm.com) – to initialize the GitHub repo.@@ -210,8 +234,10 @@ However, it is always recommended to use the newest versions of build tools. -### Installation [↑](#structure)+### Installation +[[Back to the Table of Contents] ↑](#structure)+ Summon contains two executables: * `summon`: scaffold projects using interactive CLI mode.@@ -219,12 +245,16 @@ Below you can find the description of how to install each of them so you can choose the one you want. -#### Summon-TUI [↑](#structure)+#### Summon-TUI +[[Back to the Table of Contents] ↑](#structure)+ > **NOTE:** `summon-tui` is not supported on Windows. See [this issue](https://github.com/jtdaugherty/vty/pull/1). -##### TUI: download binary [↑](#structure)+##### TUI: download binary +[[Back to the Table of Contents] ↑](#structure)+ You can download binary directly [from GitHub releases](https://github.com/kowainik/summoner/releases). After downloading binary, make it executable and copy it under convenient location, for example:@@ -234,19 +264,22 @@ mv summon-cli-linux ~/.local/bin/summon ``` -##### TUI: Homebrew [↑](#structure)+##### TUI: Homebrew +[[Back to the Table of Contents] ↑](#structure)+ If you are on MacOS, you can get Summoner using Homebrew Kowainik's Tap. -You need to run the following commands for that:+You need to run the following command for that: ```shell-$ brew tap kowainik/tap-$ brew install summoner-tui+$ brew install kowainik/tap/summoner-tui ``` -##### TUI: Ubuntu [↑](#structure)+##### TUI: Ubuntu +[[Back to the Table of Contents] ↑](#structure)+ If you are on Ubuntu, you can get Summoner from Kowainik's PPA. You need to run the following commands for that:@@ -257,8 +290,10 @@ $ sudo apt install summoner-tui ``` -##### TUI: from Hackage/Stackage [↑](#structure)+##### TUI: from Hackage/Stackage +[[Back to the Table of Contents] ↑](#structure)+ Using `cabal`: ```shell@@ -272,8 +307,10 @@ stack install summoner-tui ``` -##### TUI: from source [↑](#structure)+##### TUI: from source +[[Back to the Table of Contents] ↑](#structure)+ Fetch the repo using `cabal`: ```shell@@ -304,10 +341,14 @@ stack install summoner-tui:exe:summon-tui ``` -#### Summon-CLI [↑](#structure)+#### Summon-CLI -##### CLI: download binary [↑](#structure)+[[Back to the Table of Contents] ↑](#structure) +##### CLI: download binary++[[Back to the Table of Contents] ↑](#structure)+ You can download binary directly [from GitHub releases](https://github.com/kowainik/summoner/releases). After downloading binary, make it executable and copy it under convenient location, for example:@@ -317,19 +358,22 @@ mv summon-cli-linux ~/.local/bin/summon ``` -##### CLI: Homebrew [↑](#structure)+##### CLI: Homebrew +[[Back to the Table of Contents] ↑](#structure)+ If you are on MacOS, you can get Summoner using Homebrew Kowainik's Tap. -You need to run the following commands for that:+You need to run the following command for that: ```shell-$ brew tap kowainik/tap-$ brew install summoner-cli+$ brew install kowainik/tap/summoner-cli ``` -##### CLI: Ubuntu [↑](#structure)+##### CLI: Ubuntu +[[Back to the Table of Contents] ↑](#structure)+ If you are on Ubuntu, you can get Summoner from Kowainik's PPA. You need to run the following commands for that:@@ -340,8 +384,10 @@ $ sudo apt install summoner-cli ``` -##### CLI: from Hackage/Stackage [↑](#structure)+##### CLI: from Hackage/Stackage +[[Back to the Table of Contents] ↑](#structure)+ Using `cabal`: ```shell@@ -355,8 +401,10 @@ stack install summoner ``` -##### CLI: from source [↑](#structure)+##### CLI: from source +[[Back to the Table of Contents] ↑](#structure)+ Fetch the repo using `cabal`: ```shell@@ -387,16 +435,20 @@ stack install summoner:exe:summon ``` -### Setup [↑](#structure)+### Setup +[[Back to the Table of Contents] ↑](#structure)+ You can turn on bash auto-completion by running the following command: ```shell source <(summon --bash-completion-script `which summon`) ``` -## Usage [↑](#structure)+## Usage +[[Back to the Table of Contents] ↑](#structure)+ To start `summon`ing projects nothing additional is required. However, to tweak your settings further, you can use additional configuration settings. There are several options you can use to set particular configurations for new projects (in increasing order of priority): @@ -410,8 +462,10 @@ To cut a long story short, the configuration uses [Partial Options Monoid Pattern](https://medium.com/@jonathangfischoff/the-partial-options-monoid-pattern-31914a71fc67). -### File configuration [↑](#structure)+### File configuration +[[Back to the Table of Contents] ↑](#structure)+ Here is the list of the options that can be configured to suit your needs. If options are not specified, they are asked interactively (or some sensible defaults are used). | Field | Type | Description |@@ -446,8 +500,10 @@ For a real-life example of the configuration, see [the configuration for projects of the `Kowainik` organization](https://github.com/kowainik/org/blob/master/.summoner.toml). -### Command line arguments [↑](#structure)+### Command line arguments +[[Back to the Table of Contents] ↑](#structure)+ Available commands: ```@@ -466,8 +522,10 @@ -v, --version Show summoner's version ``` -#### **summon new** command: [↑](#structure)+#### **summon new** command: +[[Back to the Table of Contents] ↑](#structure)+ ``` Usage: summon new PROJECT_NAME [--ignore-config] [--no-upload] [--offline]@@ -513,8 +571,10 @@ -b, --benchmark Benchmarks ``` -#### **summon script** command: [↑](#structure)+#### **summon script** command: +[[Back to the Table of Contents] ↑](#structure)+ ``` Usage: summon script BUILD_TOOL [-g|--ghc GHC_VERSION] [-n|--name FILE_NAME]@@ -526,8 +586,10 @@ -n,--name FILE_NAME Name of the script file ``` -#### **summon show** command: [↑](#structure)+#### **summon show** command: +[[Back to the Table of Contents] ↑](#structure)+ ``` Usage: summon show COMMAND@@ -551,8 +613,10 @@ summon new my-project with -letgcpwa without -b --prelude-package relude --prelude-module Relude ``` -#### **summon config** command: [↑](#structure)+#### **summon config** command: +[[Back to the Table of Contents] ↑](#structure)+ ``` Usage: summon config [-f|--file=FILENAME] Create a default TOML configuration file for summoner@@ -577,10 +641,14 @@ summon config --file ~/.summoner-demo.toml ``` -### TUI [↑](#structure)+### TUI -#### TUI new command [↑](#structure)+[[Back to the Table of Contents] ↑](#structure) +#### TUI new command++[[Back to the Table of Contents] ↑](#structure)+  > **Section 1** – The main section where user inputs data or changes the configurations.@@ -613,23 +681,33 @@ Note that the form should be valid in order to be able to go to the Confirm window. If there are some errors in the input, you could see details about these errors in the `Status` section of the form. -#### TUI script command [↑](#structure)+#### TUI script command +[[Back to the Table of Contents] ↑](#structure)+ See [CLI description](#cli-script-command-) of the `summon script` command. -#### TUI show command [↑](#structure)+#### TUI show command +[[Back to the Table of Contents] ↑](#structure)+ These commands display the list of supported GHC versions or Licenses. Also, when the license name is specified the window with the scrollable content of the License text is shown. -### CLI [↑](#structure)+### CLI -#### CLI new command [↑](#structure)+[[Back to the Table of Contents] ↑](#structure) +#### CLI new command++[[Back to the Table of Contents] ↑](#structure)+ In CLI mode of operation Summoner asks about every project setting. Most of the questions contain a default value, so you can press <kbd>Enter</kbd> to choose the default value. If some option is specified via a configuration file or CLI arguments, then the question is skipped and the predefined value is used. -#### CLI script command [↑](#structure)+#### CLI script command +[[Back to the Table of Contents] ↑](#structure)+ This command creates minimal `cabal` or `stack` script file which allows you to save some keystrokes and eliminates the need to remember magic words for scripts. **Cabal example:** `summon script cabal -n Main.hs` generates executable file `Main.hs` with the following content:@@ -659,12 +737,16 @@ main = putStrLn "Hello, World!" ``` -#### CLI show command [↑](#structure)+#### CLI show command +[[Back to the Table of Contents] ↑](#structure)+ These commands display the list of supported GHC versions, or Licenses. Also, when the license name is specified, the content of the License is outputted to the terminal. -## FAQ [↑](#structure)+## FAQ +[[Back to the Table of Contents] ↑](#structure)+ > I want to use HTTPS remote for the created GitHub project, but it creates SSH one. How should I fix this? We are using `hub` tool to create the projects at GitHub. It uses SSH so that you would get the remote links in the following format:@@ -703,8 +785,10 @@ * [commersialhaskell/stack issue](https://github.com/commercialhaskell/stack/issues/4488) -## For Developers [↑](#structure)+## For Developers +[[Back to the Table of Contents] ↑](#structure)+ If you'd like to take part in the development processes, here are a few things to keep in mind: * Summoner is a multi-package project which has two packages inside: `summoner-cli` and `summoner-tui`. We are supporting the same functionality in both of them, so, if it's possible, you should add/change the code in both of the packages.@@ -713,12 +797,16 @@ * To sum up, [here is the Contributing guide](https://github.com/kowainik/.github/blob/master/CONTRIBUTING.md#contributing-to-the-kowainik-repositories) we use across the repositories. * This project is contributor-friendly, so be kind to other people working on the project. -### Dependencies [↑](#structure)+### Dependencies +[[Back to the Table of Contents] ↑](#structure)+ On Linux, to build the `summoner-tui` you'll need to have `libtinfo` installed. The easiest way to get this is from your system's package manager and is usually available as the package `libtinfo-dev`. -### Build [↑](#structure)+### Build +[[Back to the Table of Contents] ↑](#structure)+ To build the project you can use the following commands: ```shell=@@ -733,8 +821,10 @@ for Stack. -### Test [↑](#structure)+### Test +[[Back to the Table of Contents] ↑](#structure)+ Summoner uses the golden tests technique for assuring the correctness of the generated files. For this purpose, we have [the `golden` folder](https://github.com/kowainik/summoner/tree/master/summoner-cli/test/golden) with two sample projects to test against. To actually run tests you need to run:@@ -749,8 +839,10 @@ stack test ``` -### Run [↑](#structure)+### Run +[[Back to the Table of Contents] ↑](#structure)+ Building Summoner with the recommended method creates two executables: `summon` and `summon-tui`. To run the compiled executable you can use the following commands: ```shell@@ -765,7 +857,9 @@ stack exec summon-tui -- SOME_COMMAND ``` -## Acknowledgments [↑](#structure)+## Acknowledgments++[[Back to the Table of Contents] ↑](#structure) This project was inspired by [Aelve/new-hs](https://github.com/aelve/new-hs#readme), which is the tool with the same goal but it's only for creating cabal projects.
src/Summoner/Tui.hs view
@@ -27,11 +27,11 @@ vLimit, viewport) import Brick.Widgets.Edit (editAttr, editFocusedAttr) import Brick.Widgets.List (listSelectedAttr, listSelectedFocusedAttr)+import Colourista (errorMessage, infoMessage) import Lens.Micro ((.~), (^.)) import Relude.Extra.Enum (universe) import System.Directory (doesDirectoryExist, doesFileExist, getCurrentDirectory, listDirectory) -import Summoner.Ansi (errorMessage, infoMessage) import Summoner.CLI (Command (..), NewOpts (..), ShowOpts (..), getCustomLicenseText, getFinalConfig, runConfig, runScript, summon) import Summoner.Config (ConfigP (cFiles))
summoner-tui.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: summoner-tui-version: 2.0.0.0+version: 2.0.1.0 synopsis: Tool for scaffolding fully configured batteries-included production-level Haskell projects using TUI. description: Tool for scaffolding fully configured batteries-included production-level Haskell projects using TUI. See [README.md](https://github.com/kowainik/summoner#-summoner) for details.@@ -19,14 +19,15 @@ tested-with: GHC == 8.4.4 GHC == 8.6.5 GHC == 8.8.3+ GHC == 8.10.1 source-repository head type: git location: git@github.com:kowainik/summoner.git common common-options- build-depends: base >= 4.11 && < 4.14- , relude ^>= 0.6.0.0+ build-depends: base >= 4.11 && < 4.15+ , relude ^>= 0.7.0.0 mixins: base hiding (Prelude) , relude (Relude as Prelude@@ -47,6 +48,8 @@ if impl(ghc >= 8.8) ghc-options: -Wmissing-deriving-strategies -Werror=missing-deriving-strategies+ if impl(ghc >= 8.10)+ ghc-options: -Wunused-packages default-extensions: DeriveGeneric DerivingStrategies@@ -76,14 +79,14 @@ autogen-modules: Paths_summoner_tui other-modules: Paths_summoner_tui - build-depends: brick >= 0.47 && < 0.53+ build-depends: brick >= 0.47 && < 0.54+ , colourista ^>= 0.1 , directory ^>= 1.3.0.2- , filepath ^>= 1.4.1.2 , microlens ^>= 0.4 , microlens-th ^>= 0.4 , summoner ^>= 2.0.0.0 , text ^>= 1.2.3.0- , validation-selective ^>= 0.0.0.0+ , validation-selective >= 0.0.0.0 && < 0.2 , vty >= 5.25 && < 5.29 executable summon-tui