Skip to content

Commit

Permalink
feat: add module keeper alias (#3683)
Browse files Browse the repository at this point in the history
* feat: add module keeper alias

* changelog

* feedback

Co-authored-by: Jerónimo Albi <[email protected]>

---------

Co-authored-by: Jerónimo Albi <[email protected]>
Co-authored-by: Danilo Pantani <[email protected]>
  • Loading branch information
3 people authored Oct 12, 2023
1 parent 6c95328 commit 3c3b53d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@

### Changes

- [#3581](https://github.com/ignite/cli/pull/3581) Bump cometbft and cometbft-db in the template
- [#3559](https://github.com/ignite/cli/pull/3559) Bump network plugin version to `v0.1.1`
- [#3581](https://github.com/ignite/cli/pull/3581) Bump cometbft and cometbft-db in the template
- [#3522](https://github.com/ignite/cli/pull/3522) Remove indentation from `chain serve` output
- [#3601](https://github.com/ignite/cli/pull/3601) Update ts-relayer version to `0.10.0`
- [#3658](https://github.com/ignite/cli/pull/3658) Rename Marshaler to Codec in EncodingConfig
- [#3653](https://github.com/ignite/cli/pull/3653) Add "app" extension to plugin binaries
- [#3656](https://github.com/ignite/cli/pull/3656) Disable Go toolchain download
- [#3662](https://github.com/ignite/cli/pull/3662) Refactor CLI "plugin" command to "app"
- [#3669](https://github.com/ignite/cli/pull/3669) Rename `plugins` config file to `igniteapps`
- [#3683](https://github.com/ignite/cli/pull/3683) Resolve `--dep auth` as `--dep account` in `scaffold module`

### Fixes

Expand Down Expand Up @@ -618,7 +619,7 @@ Our new name is **Ignite CLI**!
automatically take care of building proto files without a need of script in the app's source code.
- Integrated third-party proto-files used by Cosmos SDK modules into Ignite CLI
- Added ability to customize binary name with `build.binary` in `config.yml`
- Added ability to change path to home directory with ` .home` in `config.yml`
- Added ability to change path to home directory with `.home` in `config.yml`
- Added ability to add accounts by `address` with in `config.yml`
- Added faucet functionality available on port 4500 and configurable with `faucet` in `config.yml`
- Added `starport faucet [address] [coins]` command
Expand Down
10 changes: 10 additions & 0 deletions ignite/cmd/scaffold_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"regexp"
"strings"

"github.com/spf13/cobra"

Expand All @@ -15,6 +16,11 @@ import (
modulecreate "github.com/ignite/cli/ignite/templates/module/create"
)

// moduleNameKeeperAlias is a map of well known module names that have a different keeper name than the usual <module-name>Keeper.
var moduleNameKeeperAlias = map[string]string{
"auth": "account",
}

const (
flagDep = "dep"
flagIBC = "ibc"
Expand Down Expand Up @@ -170,6 +176,10 @@ func scaffoldModuleHandler(cmd *cobra.Command, args []string) error {
return fmt.Errorf("invalid module dependency name format '%s'", name)
}

if alias, ok := moduleNameKeeperAlias[strings.ToLower(name)]; ok {
name = alias
}

deps = append(deps, modulecreate.NewDependency(name))
}

Expand Down

0 comments on commit 3c3b53d

Please sign in to comment.