packages feed

summoner-tui 2.1.0.0 → 2.2.0.0

raw patch · 6 files changed

+53/−29 lines, 6 filesdep ~summonerPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: summoner

API changes (from Hackage documentation)

+ Summoner.Tui.Form: GitHubBranch :: SummonForm
+ Summoner.Tui.Kit: [gitHubBranch] :: GitHub -> !Text
+ Summoner.Tui.Kit: branch :: HasBranch s a => Lens' s a
+ Summoner.Tui.Kit: instance Summoner.Tui.Kit.HasBranch Summoner.Tui.Kit.GitHub Data.Text.Internal.Text
- Summoner.Tui.Kit: GitHub :: !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> GitHub
+ Summoner.Tui.Kit: GitHub :: !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Text -> GitHub

Files

CHANGELOG.md view
@@ -3,6 +3,14 @@ `summoner` uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +# 2.2.0.0 – Jan 16, 2026++* [#560](https://github.com/kowainik/summoner/issues/560):+  Allow configurations of the branch name.+* [#578](https://github.com/kowainik/summoner/pull/578):+  Replace usage of hub with `gh`.+* Roll back to GHC-9.12.2 as 9.12.3 has a major regression.+ ## 2.1.0.0 — Jan 6, 2026  * Support GHC-9.12.3. Use GHC-9.12.3 as the default version for
README.md view
@@ -235,7 +235,7 @@ To start using Summoner make sure that you have the following tools installed on your machine:  * [`git`](https://git-scm.com) ⩾ 2.28 – to initialize the GitHub repo.-* [`hub`](https://github.com/github/hub) – to upload the project to GitHub.+* [`gh`](https://github.com/cli/cli) – to upload the project to GitHub. * [`curl`](https://curl.haxx.se) – to download licenses.  We also have minimal version requirements for build tools:@@ -475,7 +475,7 @@ | `fullName`       | Text    | Full name.                                                                                                                                                           | | `email`          | Text    | E-mail address.                                                                                                                                                      | | `license`        | License | One of: `MIT`, `BSD2`, `BSD3`, `GPL-2`, `GPL-3`, `LGPL-2.1`, `LGPL-3`, `AGPL-3`, `Apache-2.0`, `MPL-2.0`, `None`.                                                    |-| `ghcVersions`    | [GHC]   | `summoner` uses default `GHC-9.12.3`. However, additionally you can specify other versions. For each version `x.y.z` the `stack-x.y.z.yaml` will be created. Use `summon show ghc` to see all supported GHC versions. |+| `ghcVersions`    | [GHC]   | `summoner` uses default `GHC-9.12.2`. However, additionally you can specify other versions. For each version `x.y.z` the `stack-x.y.z.yaml` will be created. Use `summon show ghc` to see all supported GHC versions. | | `github`         | Bool    | Turn on `GitHub` integration by default?                                                                                                                             | | `gitignore`      | [Text]  | List of files you want added to the default `.gitignore`. (Ignored if `github = false`)                                                                              | | `noUpload`       | Bool    | Do not upload to GitHub, but create all GitHub related files if specified (Ignored if `github = false`)                                                              |@@ -746,28 +746,25 @@  [[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:--```-git@github.com:user/repo.git-```+> I want to use SSH/HTTPS remote for the created GitHub project, but it creates the repository with the wrong protocol. How should I fix this? -We can not change or configure this behaviour, but there are several workarounds in case you _need_ to use HTTPS link for the remote.+We use the official Github CLI tool (`gh`) to create the projects on GitHub.  `gh` has its own configuration for+choosing HTTPS/SSH protocols. There are two options for configuring this: -1. Change the remote of the repository after its creation:-   ```-   git remote set-url origin https://github.com/user/repo.git-   ```-2. Change `hub` configurations globally. Simply run the following command:-   ```shell-   git config --global hub.protocol https-   ```-3. Alternatively, change `hub` configurations for a single session:-   ```-   export HUB_PROTOCOL="https"-   ```+- You can configure it permanently for the `gh` tool:+  ```shell+  # Set HTTPS as the default configuration+  gh config set git_protocol https+  # Set SSH as the default configuration+  gh config set git_protocol ssh+  ```+- You can adjusting the remote configuration after the repository is created locally with+  ```shell+  # Set HTTPS as the remote URL+  git remote set-url origin https://github.com/<OWNER>/<REPO>.git+  # Set SSH as the remote URL+  git remote set-url origin git@github.com:<OWNER>/<REPO>.git+  ```  <hr> 
src/Summoner/Tui/Form.hs view
@@ -71,6 +71,7 @@     | GitHubActions     | GitHubTravis     | GitHubAppVeyor+    | GitHubBranch     deriving stock (Show, Eq, Ord, Enum, Bounded)  -- | Alias for type of the @summoner@ form.@@ -127,6 +128,7 @@         , 1 |> activeCheckboxField (gitHub . actions)  isActive GitHubActions  "GitHub Actions"         , 1 |> activeCheckboxField (gitHub . travis)   isActive GitHubTravis   "Travis"         , 2 |> activeCheckboxField (gitHub . appVeyor) isActive GitHubAppVeyor "AppVeyor"+        , 2 |> label "Branch " @@= editTextField (gitHub . branch) GitHubBranch (Just 1)         ]     ) sk   where
src/Summoner/Tui/Kit.hs view
@@ -68,6 +68,7 @@        , actions        , travis        , appVeyor+       , branch        ) where  import Lens.Micro (Lens', lens, (.~), (^.))@@ -139,6 +140,7 @@     , gitHubActions  :: !Bool     , gitHubTravis   :: !Bool     , gitHubAppVeyor :: !Bool+    , gitHubBranch   :: !Text     } deriving stock (Show)  makeFields ''SummonKit@@ -189,6 +191,7 @@     , settingsStack          = sk ^. stack     , settingsNoUpload       = sk ^. gitHub . noUpload     , settingsFiles          = sk ^. extraFiles+    , settingsBranchName     = if isGitHub then sk ^. gitHub . branch else "main"     }   where     isGitHub :: Bool@@ -255,6 +258,7 @@         , gitHubActions  = (cGitHub /= Nop) && (cGhActions /= Nop) && kitCabal         , gitHubTravis   = (cGitHub /= Nop) && (cTravis /= Nop)         , gitHubAppVeyor = decisionToBool cAppVey+        , gitHubBranch   = cBranchName         }     , summonKitExtensions   = cExtensions     , summonKitGhcOptions   = cGhcOptions
src/Summoner/Tui/Validation.hs view
@@ -98,6 +98,8 @@     | PreludePackageError     -- | Prelude module name restrictions check. See 'moduleNameValid'.     | PreludeModuleError+    -- | Branch name must not be empty when GitHub is enabled.+    | EmptyBranchName  -- | Show 'FormError' to display later in TUI. showFormError :: FormError -> String@@ -109,6 +111,7 @@     LibOrExe     -> "Choose at least one: Library or Executable"     PreludePackageError -> "Prelude package should only contain letters, numbers and hyphens"     PreludeModuleError -> "Prelude module name could only contain dot-separated capitalized letter/numeral fragments. Ex: This.Is.Valid1"+    EmptyBranchName -> "Branch name must not be empty when GitHub is enabled"   where     joinFields :: NonEmpty SummonForm -> String     joinFields = intercalate ", " . mapMaybe showField . toList@@ -123,6 +126,7 @@         ProjectCat          -> Just "Category"         CustomPreludeName   -> Just "Prelude name"         CustomPreludeModule -> Just "Module"+        GitHubBranch        -> Just "Branch"         _nonMandatoryFields -> Nothing  -- | Returns list of all invalid fields according to the error.@@ -135,6 +139,7 @@     LibOrExe            -> Lib :| [Exe]     PreludePackageError -> one CustomPreludeName     PreludeModuleError  -> one CustomPreludeModule+    EmptyBranchName     -> one GitHubBranch  -- | Validates 'SummonKit' and returns list of all possible errors or success. validateKit :: [FilePath] -> SummonKit -> Validation (NonEmpty FormError) ()@@ -146,6 +151,7 @@     *> validateLibOrExe     *> validatePreludePackage     *> validatePreludeModule+    *> validateBranchName   where     liftValidation         :: (e -> FormError)@@ -223,6 +229,17 @@       where         moduleName :: Text         moduleName  = kit ^. projectMeta . preludeModule++    validateBranchName :: Validation (NonEmpty FormError) ()+    validateBranchName = failureIf+        (isGitHubEnabled && T.null (T.strip branchName))+        EmptyBranchName+      where+        isGitHubEnabled :: Bool+        isGitHubEnabled = kit ^. gitHub . enabled++        branchName :: Text+        branchName = kit ^. gitHub . branch  -- | Returns list of error messages according to all invalid fields. formErrorMessages :: [FilePath] -> KitForm e -> [String]
summoner-tui.cabal view
@@ -1,6 +1,6 @@ cabal-version:       3.4 name:                summoner-tui-version:             2.1.0.0+version:             2.2.0.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.@@ -26,7 +26,7 @@                      GHC == 9.6.7                      GHC == 9.8.4                      GHC == 9.10.3-                     GHC == 9.12.3+                     GHC == 9.12.2  source-repository head   type:     git@@ -91,8 +91,6 @@  library   import:              common-options-  if os(windows)-    buildable: False   hs-source-dirs:      src   exposed-modules:     Summoner.Tui                          Summoner.Tui.Field@@ -110,15 +108,13 @@                      , directory ^>= 1.3.0.2                      , microlens ^>= 0.4                      , microlens-th ^>= 0.4-                     , summoner ^>= 2.1.0.0+                     , summoner ^>= 2.2.0.0                      , validation-selective >= 0.0.0.0 && < 0.3                      , vty >= 6.0 && < 6.3                      , vty-crossplatform >= 0.2 && < 0.3  executable summon-tui   import:              common-options-  if os(windows)-    buildable: False   hs-source-dirs:      app   main-is:             Tui.hs   build-depends:       summoner-tui