diff --git a/.github/ISSUE_TEMPLATE/release-tracker.md b/.github/ISSUE_TEMPLATE/release-tracker.md index 71707be2cb..808dd30d0a 100644 --- a/.github/ISSUE_TEMPLATE/release-tracker.md +++ b/.github/ISSUE_TEMPLATE/release-tracker.md @@ -21,10 +21,9 @@ v without deliberation - ### Other testing -## Migration +## Migration @@ -32,8 +31,11 @@ versions of cli to guarantee that no regression is introduced --> -- [ ] Branch off main to create release branch in the form of `release/vx.y.z`. -- [ ] Add branch protection rules to new release branch. +- [ ] Update Ignite CLI version (see [#3793](https://github.com/ignite/cli/pull/3793) for example): + - [ ] Rename module version in go.mod to `/vXX` (where `XX` is the new version number). + - [ ] Update plugins go plush, protos and re-generate them + - [ ] Update documentation links (docs/docs) + - [ ] Update GitHub actions, goreleaser and other CI/CD scripts ## Post-release checklist diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 3d7f1c4bd2..18581f5a14 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -2,8 +2,6 @@ name: Release nightly on: workflow_dispatch: - branches: - - main push: branches: - main @@ -16,13 +14,13 @@ jobs: consecutiveness: runs-on: ubuntu-latest steps: - - uses: ignite/consecutive-workflow-action@main - with: - token: ${{ secrets.GITHUB_TOKEN }} + - uses: ignite/consecutive-workflow-action@main + with: + token: ${{ secrets.GITHUB_TOKEN }} release-nightly: runs-on: ubuntu-latest - needs: [ consecutiveness ] + needs: [consecutiveness] env: working-directory: go/src/github.com/ignite/cli @@ -70,5 +68,5 @@ jobs: release_name: "nightly" goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }} - ldflags: -s -w -X github.com/ignite/cli/ignite/version.Version=nightly + ldflags: -s -w -X github.com/ignite/cli/v28/ignite/version.Version=nightly retry: 10 diff --git a/.goreleaser.yml b/.goreleaser.yml index 3c075c1b3b..ef5acdc0c4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,7 +2,7 @@ project_name: ignite builds: - main: ./ignite/cmd/ignite ldflags: - - -s -w -X github.com/ignite/cli/ignite/version.Version={{.Tag}} + - -s -w -X github.com/ignite/cli/v28/ignite/version.Version={{.Tag}} goos: - linux - darwin diff --git a/Makefile b/Makefile index 97c20de6d9..732651b6f8 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ govulncheck: format: @echo Formatting... @go run mvdan.cc/gofumpt -w . - @go run golang.org/x/tools/cmd/goimports -w -local github.com/ignite/cli . + @go run golang.org/x/tools/cmd/goimports -w -local github.com/ignite/cli/v28 . @go run github.com/tbruyelle/mdgofmt/cmd/mdgofmt -w docs ## lint: Run Golang CI Lint. @@ -64,7 +64,7 @@ lint-fix: .PHONY: govet format lint ## proto-all: Format, lint and generate code from proto files using buf. -proto-all: proto-format proto-lint proto-gen +proto-all: proto-format proto-lint proto-gen format ## proto-gen: Run buf generate. proto-gen: diff --git a/changelog.md b/changelog.md index 5da32152a6..37797bd902 100644 --- a/changelog.md +++ b/changelog.md @@ -2,31 +2,31 @@ ## Unreleased +## [`v28.0.0`](https://github.com/ignite/cli/releases/tag/v28.0.0) + ### Features +- [#3659](https://github.com/ignite/cli/pull/3659) cosmos-sdk `v0.50.x` upgrade - [#3694](https://github.com/ignite/cli/pull/3694) Query and Tx AutoCLI support -- [#3544](https://github.com/ignite/cli/pull/3544) Add bidirectional communication to plugin system +- [#3536](https://github.com/ignite/cli/pull/3536) Change app.go to v2 and add AppWiring feature +- [#3544](https://github.com/ignite/cli/pull/3544) Add bidirectional communication to app (plugin) system +- [#3756](https://github.com/ignite/cli/pull/3756) Add faucet compatibility for latest sdk chains +- [#3476](https://github.com/ignite/cli/pull/3476) Use `buf.build` binary to code generate from proto files +- [#3724](https://github.com/ignite/cli/pull/3724) Add or vendor proto packages from Go dependencies - [#3561](https://github.com/ignite/cli/pull/3561) Add GetChainInfo method to plugin system API - [#3626](https://github.com/ignite/cli/pull/3626) Add logging levels to relayer -- [#3476](https://github.com/ignite/cli/pull/3476) Use `buf.build` binary to code generate from proto files -- [#3599](https://github.com/ignite/cli/pull/3599) Add google analytics - [#3614](https://github.com/ignite/cli/pull/3614) feat: use DefaultBaseappOptions for app.New method -- [#3536](https://github.com/ignite/cli/pull/3536) Change app.go to v2 and add AppWiring feature -- [#3659](https://github.com/ignite/cli/pull/3659) cosmos-sdk `v0.50.x` -- [#3670](https://github.com/ignite/cli/pull/3670) Remove nodetime binaries -- [#3724](https://github.com/ignite/cli/pull/3724) Add or vendor proto packages from Go dependencies - [#3715](https://github.com/ignite/cli/pull/3715) Add test suite for the cli tests -- [#3756](https://github.com/ignite/cli/pull/3756) Add faucet compatibility for latest sdk chains ### Changes +- [#3793](https://github.com/ignite/cli/pull/3793) Refactor Ignite to follow semantic versioning (prepares v28.0.0). If you are using packages, do not forget to import the `/v28` version of the packages. - [#3529](https://github.com/ignite/cli/pull/3529) Refactor plugin system to use gRPC -- [#3750](https://github.com/ignite/cli/pull/3750) Update default Ignite network app to `v0.2.0` - [#3751](https://github.com/ignite/cli/pull/3751) Rename label to skip changelog check - [#3745](https://github.com/ignite/cli/pull/3745) Set tx fee amount as option - [#3748](https://github.com/ignite/cli/pull/3748) Change default rpc endpoint to a working one - [#3621](https://github.com/ignite/cli/pull/3621) Change `pkg/availableport` to allow custom parameters in `Find` function and handle duplicated ports -- [#3559](https://github.com/ignite/cli/pull/3559) Bump network plugin version to `v0.1.1` +- [#3810](https://github.com/ignite/cli/pull/3810) Bump network app version to `v0.2.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 - [#3346](https://github.com/ignite/cli/issues/3346) Improve scaffold query --help @@ -38,6 +38,8 @@ - [#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` - [#3795](https://github.com/ignite/cli/pull/3795) Bump cometbft to `v0.38.2` +- [#3599](https://github.com/ignite/cli/pull/3599) Add analytics as an option +- [#3670](https://github.com/ignite/cli/pull/3670) Remove binaries ### Fixes @@ -47,7 +49,6 @@ - [#3610](https://github.com/ignite/cli/pull/3610) Fix overflow issue of cosmos faucet in `pkg/cosmosfaucet/transfer.go` and `pkg/cosmosfaucet/cosmosfaucet.go` - [#3618](https://github.com/ignite/cli/pull/3618) Fix TS client generation import path issue - [#3631](https://github.com/ignite/cli/pull/3631) Fix unnecessary vue import in hooks/composables template -- [#3655](https://github.com/ignite/cli/pull/3655) Re-enable TS client generation - [#3661](https://github.com/ignite/cli/pull/3661) Change `pkg/cosmosanalysis` to find Cosmos SDK runtime app registered modules - [#3716](https://github.com/ignite/cli/pull/3716) Fix invalid plugin hook check - [#3725](https://github.com/ignite/cli/pull/3725) Fix flaky TS client generation issues on linux @@ -55,6 +56,7 @@ - [#3728](https://github.com/ignite/cli/pull/3728) Fix wrong parser for proto package names - [#3729](https://github.com/ignite/cli/pull/3729) Fix broken generator due to caching /tmp include folders - [#3767](https://github.com/ignite/cli/pull/3767) Fix `v0.50` ibc genesis issue +- [#3808](https://github.com/ignite/cli/pull/3808) Correct TS code generation to generate paginated fields ## [`v0.27.2`](https://github.com/ignite/cli/releases/tag/v0.27.2) @@ -790,4 +792,4 @@ Our new name is **Ignite CLI**! ## `v0.0.9` -Initial release. \ No newline at end of file +Initial release. diff --git a/docs/docs/03-clients/01-go-client.md b/docs/docs/03-clients/01-go-client.md index 01bedd61f1..7b46127f79 100644 --- a/docs/docs/03-clients/01-go-client.md +++ b/docs/docs/03-clients/01-go-client.md @@ -119,7 +119,7 @@ import ( "log" // Importing the general purpose Cosmos blockchain client - "github.com/ignite/cli/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" // Importing the types package of your blog blockchain "blog/x/blog/types" diff --git a/docs/docs/07-packages/cosmostxcollector.md b/docs/docs/07-packages/cosmostxcollector.md index 62047e4ff9..cf779d36fa 100644 --- a/docs/docs/07-packages/cosmostxcollector.md +++ b/docs/docs/07-packages/cosmostxcollector.md @@ -40,10 +40,10 @@ import ( "context" "log" - "github.com/ignite/cli/ignite/pkg/clictx" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/adapter/postgres" + "github.com/ignite/cli/v28/ignite/pkg/clictx" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/adapter/postgres" ) const ( diff --git a/go.mod b/go.mod index a688402a65..10663c2610 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/ignite/cli +module github.com/ignite/cli/v28 go 1.21.1 @@ -54,9 +54,9 @@ require ( github.com/hashicorp/go-hclog v1.5.0 github.com/hashicorp/go-plugin v1.5.2 github.com/iancoleman/strcase v0.3.0 - github.com/ignite/ignite-files/nodetime v0.0.2 + github.com/ignite/ignite-files/nodetime v0.0.3 github.com/ignite/ignite-files/protoc v0.0.1 - github.com/ignite/web v0.5.1 + github.com/ignite/web v0.6.1 github.com/imdario/mergo v0.3.13 github.com/jpillora/chisel v1.9.1 github.com/lib/pq v1.10.9 diff --git a/go.sum b/go.sum index 7380e103f7..38d6c616bc 100644 --- a/go.sum +++ b/go.sum @@ -879,12 +879,12 @@ github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= -github.com/ignite/ignite-files/nodetime v0.0.2 h1:9Aj0OEa7FWI22J/Zdq7M2JvsjgFLngZSm7vB4i9X4t4= -github.com/ignite/ignite-files/nodetime v0.0.2/go.mod h1:GKDsXdeazHyhSBPdVLp7mNIo/m9LmZ6/h8RmQ0/CoaM= +github.com/ignite/ignite-files/nodetime v0.0.3 h1:LermGsHfgGC9fTHMJ7SM8H6EiNnNpRSd88q2kqrj40E= +github.com/ignite/ignite-files/nodetime v0.0.3/go.mod h1:GKDsXdeazHyhSBPdVLp7mNIo/m9LmZ6/h8RmQ0/CoaM= github.com/ignite/ignite-files/protoc v0.0.1 h1:wXxU1dzruUgSVl1diAuAOA+xv0NQKXJFsDWht2+tAP8= github.com/ignite/ignite-files/protoc v0.0.1/go.mod h1:cVCHJbEHPIeKHMPk3ZoPS0Xw4XQfUc76BAMAPU9Fwjg= -github.com/ignite/web v0.5.1 h1:xGOt8wJG7WIrNO30e8Zbm669VFyo6sje/vWnusLPp6k= -github.com/ignite/web v0.5.1/go.mod h1:WZWBaBYF8RazN7dE462BLpvXDY8ScacxcJ07BKwX/jY= +github.com/ignite/web v0.6.1 h1:kHG+T7NnR8cCPjAGxEFQD+njVYM08toeG57iYRXzpwo= +github.com/ignite/web v0.6.1/go.mod h1:WZWBaBYF8RazN7dE462BLpvXDY8ScacxcJ07BKwX/jY= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= diff --git a/ignite/cmd/account.go b/ignite/cmd/account.go index 641020c822..133e73b36d 100644 --- a/ignite/cmd/account.go +++ b/ignite/cmd/account.go @@ -6,9 +6,9 @@ import ( "github.com/spf13/cobra" flag "github.com/spf13/pflag" - "github.com/ignite/cli/ignite/pkg/cliui/cliquiz" - "github.com/ignite/cli/ignite/pkg/cliui/entrywriter" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cliui/cliquiz" + "github.com/ignite/cli/v28/ignite/pkg/cliui/entrywriter" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) const ( diff --git a/ignite/cmd/account_create.go b/ignite/cmd/account_create.go index adcedeef1b..ed0ae23a5f 100644 --- a/ignite/cmd/account_create.go +++ b/ignite/cmd/account_create.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) func NewAccountCreate() *cobra.Command { diff --git a/ignite/cmd/account_delete.go b/ignite/cmd/account_delete.go index bc07004fbe..1c82627667 100644 --- a/ignite/cmd/account_delete.go +++ b/ignite/cmd/account_delete.go @@ -3,7 +3,7 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) func NewAccountDelete() *cobra.Command { diff --git a/ignite/cmd/account_export.go b/ignite/cmd/account_export.go index 8a36b8f479..5c91f7b0c9 100644 --- a/ignite/cmd/account_export.go +++ b/ignite/cmd/account_export.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) func NewAccountExport() *cobra.Command { diff --git a/ignite/cmd/account_import.go b/ignite/cmd/account_import.go index dd77f212b6..48265e0419 100644 --- a/ignite/cmd/account_import.go +++ b/ignite/cmd/account_import.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/go-bip39" "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui/cliquiz" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cliui/cliquiz" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) const flagSecret = "secret" diff --git a/ignite/cmd/account_list.go b/ignite/cmd/account_list.go index 88b4d85458..d30110dd1f 100644 --- a/ignite/cmd/account_list.go +++ b/ignite/cmd/account_list.go @@ -3,7 +3,7 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) func NewAccountList() *cobra.Command { diff --git a/ignite/cmd/account_show.go b/ignite/cmd/account_show.go index dedc2e652a..2be302ff2a 100644 --- a/ignite/cmd/account_show.go +++ b/ignite/cmd/account_show.go @@ -3,7 +3,7 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) func NewAccountShow() *cobra.Command { diff --git a/ignite/cmd/chain.go b/ignite/cmd/chain.go index bd01f1356c..aa449cc3cb 100644 --- a/ignite/cmd/chain.go +++ b/ignite/cmd/chain.go @@ -11,16 +11,16 @@ import ( "github.com/manifoldco/promptui" "github.com/spf13/cobra" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/cosmosgen" - "github.com/ignite/cli/ignite/pkg/goanalysis" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/xast" - "github.com/ignite/cli/ignite/services/chain" - "github.com/ignite/cli/ignite/services/doctor" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" + "github.com/ignite/cli/v28/ignite/pkg/goanalysis" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/xast" + "github.com/ignite/cli/v28/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/services/doctor" ) const ( diff --git a/ignite/cmd/chain_build.go b/ignite/cmd/chain_build.go index 7ba3ff5194..47ab548c07 100644 --- a/ignite/cmd/chain_build.go +++ b/ignite/cmd/chain_build.go @@ -6,11 +6,11 @@ import ( "github.com/spf13/cobra" flag "github.com/spf13/pflag" - "github.com/ignite/cli/ignite/pkg/chaincmd" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/services/chain" ) const ( diff --git a/ignite/cmd/chain_debug.go b/ignite/cmd/chain_debug.go index e2c44f02f4..97f9220cc8 100644 --- a/ignite/cmd/chain_debug.go +++ b/ignite/cmd/chain_debug.go @@ -8,15 +8,15 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/spf13/cobra" - cmdmodel "github.com/ignite/cli/ignite/cmd/model" - "github.com/ignite/cli/ignite/pkg/chaincmd" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - cliuimodel "github.com/ignite/cli/ignite/pkg/cliui/model" - "github.com/ignite/cli/ignite/pkg/debugger" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/pkg/xurl" - "github.com/ignite/cli/ignite/services/chain" + cmdmodel "github.com/ignite/cli/v28/ignite/cmd/model" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + cliuimodel "github.com/ignite/cli/v28/ignite/pkg/cliui/model" + "github.com/ignite/cli/v28/ignite/pkg/debugger" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + "github.com/ignite/cli/v28/ignite/services/chain" ) const ( diff --git a/ignite/cmd/chain_faucet.go b/ignite/cmd/chain_faucet.go index c27891caf3..5bd4e06427 100644 --- a/ignite/cmd/chain_faucet.go +++ b/ignite/cmd/chain_faucet.go @@ -4,9 +4,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/chaincmd" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/services/chain" ) // NewChainFaucet creates a new faucet command to send coins to accounts. diff --git a/ignite/cmd/chain_init.go b/ignite/cmd/chain_init.go index d2132e6552..8b49729815 100644 --- a/ignite/cmd/chain_init.go +++ b/ignite/cmd/chain_init.go @@ -3,11 +3,11 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/chaincmd" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/services/chain" ) func NewChainInit() *cobra.Command { diff --git a/ignite/cmd/chain_serve.go b/ignite/cmd/chain_serve.go index eead20a263..56e1da6183 100644 --- a/ignite/cmd/chain_serve.go +++ b/ignite/cmd/chain_serve.go @@ -7,13 +7,13 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/spf13/cobra" - cmdmodel "github.com/ignite/cli/ignite/cmd/model" - "github.com/ignite/cli/ignite/pkg/cliui" - uilog "github.com/ignite/cli/ignite/pkg/cliui/log" - cliuimodel "github.com/ignite/cli/ignite/pkg/cliui/model" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/services/chain" + cmdmodel "github.com/ignite/cli/v28/ignite/cmd/model" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + uilog "github.com/ignite/cli/v28/ignite/pkg/cliui/log" + cliuimodel "github.com/ignite/cli/v28/ignite/pkg/cliui/model" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/services/chain" ) const ( diff --git a/ignite/cmd/chain_simulate.go b/ignite/cmd/chain_simulate.go index ef0c040633..8a2c340643 100644 --- a/ignite/cmd/chain_simulate.go +++ b/ignite/cmd/chain_simulate.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/services/chain" ) const ( diff --git a/ignite/cmd/cmd.go b/ignite/cmd/cmd.go index 7549336770..f595b46889 100644 --- a/ignite/cmd/cmd.go +++ b/ignite/cmd/cmd.go @@ -12,16 +12,16 @@ import ( "github.com/spf13/cobra" flag "github.com/spf13/pflag" - "github.com/ignite/cli/ignite/config" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - uilog "github.com/ignite/cli/ignite/pkg/cliui/log" - "github.com/ignite/cli/ignite/pkg/gitpod" - "github.com/ignite/cli/ignite/pkg/goenv" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/services/chain" - "github.com/ignite/cli/ignite/version" + "github.com/ignite/cli/v28/ignite/config" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + uilog "github.com/ignite/cli/v28/ignite/pkg/cliui/log" + "github.com/ignite/cli/v28/ignite/pkg/gitpod" + "github.com/ignite/cli/v28/ignite/pkg/goenv" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/version" ) const ( diff --git a/ignite/cmd/docs.go b/ignite/cmd/docs.go index ad35367074..e0d478365f 100644 --- a/ignite/cmd/docs.go +++ b/ignite/cmd/docs.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/docs" - "github.com/ignite/cli/ignite/pkg/localfs" - "github.com/ignite/cli/ignite/pkg/markdownviewer" + "github.com/ignite/cli/v28/docs" + "github.com/ignite/cli/v28/ignite/pkg/localfs" + "github.com/ignite/cli/v28/ignite/pkg/markdownviewer" ) func NewDocs() *cobra.Command { diff --git a/ignite/cmd/doctor.go b/ignite/cmd/doctor.go index 072b6d5edb..ba810a64bc 100644 --- a/ignite/cmd/doctor.go +++ b/ignite/cmd/doctor.go @@ -3,8 +3,8 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/services/doctor" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/services/doctor" ) func NewDoctor() *cobra.Command { diff --git a/ignite/cmd/generate_composables.go b/ignite/cmd/generate_composables.go index 258a9acc47..c18d65a6b0 100644 --- a/ignite/cmd/generate_composables.go +++ b/ignite/cmd/generate_composables.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/services/chain" ) func NewGenerateComposables() *cobra.Command { diff --git a/ignite/cmd/generate_go.go b/ignite/cmd/generate_go.go index 263ebd388b..7b61be77a4 100644 --- a/ignite/cmd/generate_go.go +++ b/ignite/cmd/generate_go.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/services/chain" ) func NewGenerateGo() *cobra.Command { diff --git a/ignite/cmd/generate_hooks.go b/ignite/cmd/generate_hooks.go index 76f125f498..b4ee9e8d49 100644 --- a/ignite/cmd/generate_hooks.go +++ b/ignite/cmd/generate_hooks.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/services/chain" ) func NewGenerateHooks() *cobra.Command { diff --git a/ignite/cmd/generate_openapi.go b/ignite/cmd/generate_openapi.go index e0795e0d06..4bd830ed85 100644 --- a/ignite/cmd/generate_openapi.go +++ b/ignite/cmd/generate_openapi.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/services/chain" ) func NewGenerateOpenAPI() *cobra.Command { diff --git a/ignite/cmd/generate_typescript_client.go b/ignite/cmd/generate_typescript_client.go index 3bb349ca73..86b1a11f1b 100644 --- a/ignite/cmd/generate_typescript_client.go +++ b/ignite/cmd/generate_typescript_client.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/services/chain" ) const ( diff --git a/ignite/cmd/generate_vuex.go b/ignite/cmd/generate_vuex.go index 41880b4aa3..64ef327ffe 100644 --- a/ignite/cmd/generate_vuex.go +++ b/ignite/cmd/generate_vuex.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/services/chain" ) func NewGenerateVuex() *cobra.Command { diff --git a/ignite/cmd/ignite/main.go b/ignite/cmd/ignite/main.go index f61a3f611b..afe1b2b3b5 100644 --- a/ignite/cmd/ignite/main.go +++ b/ignite/cmd/ignite/main.go @@ -7,14 +7,14 @@ import ( "os" "sync" - ignitecmd "github.com/ignite/cli/ignite/cmd" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/internal/analytics" - "github.com/ignite/cli/ignite/pkg/clictx" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/validation" - "github.com/ignite/cli/ignite/pkg/xstrings" + ignitecmd "github.com/ignite/cli/v28/ignite/cmd" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/internal/analytics" + "github.com/ignite/cli/v28/ignite/pkg/clictx" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/validation" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) func main() { @@ -23,20 +23,6 @@ func main() { func run() int { const exitCodeOK, exitCodeError = 0, 1 - var wg sync.WaitGroup - - defer func() { - if r := recover(); r != nil { - analytics.SendMetric(&wg, os.Args, analytics.WithError(fmt.Errorf("%v", r))) - fmt.Println(r) - os.Exit(exitCodeError) - } - }() - - if len(os.Args) > 1 { - analytics.SendMetric(&wg, os.Args) - } - ctx := clictx.From(context.Background()) cmd, cleanUp, err := ignitecmd.New(ctx) if err != nil { @@ -45,6 +31,15 @@ func run() int { } defer cleanUp() + // find command and send to analytics + subCmd, _, err := cmd.Find(os.Args[1:]) + if err != nil { + fmt.Printf("%v\n", err) + return exitCodeError + } + var wg sync.WaitGroup + analytics.SendMetric(&wg, subCmd) + err = cmd.ExecuteContext(ctx) if errors.Is(ctx.Err(), context.Canceled) || errors.Is(err, context.Canceled) { fmt.Println("aborted") diff --git a/ignite/cmd/model/chain_debug.go b/ignite/cmd/model/chain_debug.go index 5395c02b28..d8dbc594a6 100644 --- a/ignite/cmd/model/chain_debug.go +++ b/ignite/cmd/model/chain_debug.go @@ -7,11 +7,11 @@ import ( tea "github.com/charmbracelet/bubbletea" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - cliuimodel "github.com/ignite/cli/ignite/pkg/cliui/model" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + cliuimodel "github.com/ignite/cli/v28/ignite/pkg/cliui/model" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) const ( diff --git a/ignite/cmd/model/chain_debug_test.go b/ignite/cmd/model/chain_debug_test.go index 4e622daffb..44c5a904cf 100644 --- a/ignite/cmd/model/chain_debug_test.go +++ b/ignite/cmd/model/chain_debug_test.go @@ -8,12 +8,12 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/stretchr/testify/require" - cmdmodel "github.com/ignite/cli/ignite/cmd/model" - "github.com/ignite/cli/ignite/cmd/model/testdata" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - cliuimodel "github.com/ignite/cli/ignite/pkg/cliui/model" - "github.com/ignite/cli/ignite/pkg/events" + cmdmodel "github.com/ignite/cli/v28/ignite/cmd/model" + "github.com/ignite/cli/v28/ignite/cmd/model/testdata" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + cliuimodel "github.com/ignite/cli/v28/ignite/pkg/cliui/model" + "github.com/ignite/cli/v28/ignite/pkg/events" ) func TestChainDebugErrorView(t *testing.T) { diff --git a/ignite/cmd/model/chain_serve.go b/ignite/cmd/model/chain_serve.go index ce05ab0628..639883a97a 100644 --- a/ignite/cmd/model/chain_serve.go +++ b/ignite/cmd/model/chain_serve.go @@ -7,10 +7,10 @@ import ( tea "github.com/charmbracelet/bubbletea" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - cliuimodel "github.com/ignite/cli/ignite/pkg/cliui/model" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + cliuimodel "github.com/ignite/cli/v28/ignite/pkg/cliui/model" + "github.com/ignite/cli/v28/ignite/pkg/events" ) const ( diff --git a/ignite/cmd/model/chain_serve_test.go b/ignite/cmd/model/chain_serve_test.go index 99c47eaa96..a14167cb5f 100644 --- a/ignite/cmd/model/chain_serve_test.go +++ b/ignite/cmd/model/chain_serve_test.go @@ -10,12 +10,12 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/stretchr/testify/require" - cmdmodel "github.com/ignite/cli/ignite/cmd/model" - "github.com/ignite/cli/ignite/cmd/model/testdata" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - cliuimodel "github.com/ignite/cli/ignite/pkg/cliui/model" - "github.com/ignite/cli/ignite/pkg/events" + cmdmodel "github.com/ignite/cli/v28/ignite/cmd/model" + "github.com/ignite/cli/v28/ignite/cmd/model/testdata" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + cliuimodel "github.com/ignite/cli/v28/ignite/pkg/cliui/model" + "github.com/ignite/cli/v28/ignite/pkg/events" ) var chainServeActions = colors.Faint("Press the 'q' key to stop serve") diff --git a/ignite/cmd/model/testdata/testdata.go b/ignite/cmd/model/testdata/testdata.go index 7dc1c483a2..cb434e9f83 100644 --- a/ignite/cmd/model/testdata/testdata.go +++ b/ignite/cmd/model/testdata/testdata.go @@ -5,7 +5,7 @@ import ( tea "github.com/charmbracelet/bubbletea" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/events" ) func FooCmd() tea.Msg { return nil } diff --git a/ignite/cmd/node.go b/ignite/cmd/node.go index 64e6f9c68c..d4fec32bdd 100644 --- a/ignite/cmd/node.go +++ b/ignite/cmd/node.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/xurl" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/xurl" ) const ( diff --git a/ignite/cmd/node_query_bank_balances.go b/ignite/cmd/node_query_bank_balances.go index 8f0275e27f..44b949cd38 100644 --- a/ignite/cmd/node_query_bank_balances.go +++ b/ignite/cmd/node_query_bank_balances.go @@ -3,7 +3,7 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui" ) func NewNodeQueryBankBalances() *cobra.Command { diff --git a/ignite/cmd/node_query_tx.go b/ignite/cmd/node_query_tx.go index e4d1d7d1f3..d216062199 100644 --- a/ignite/cmd/node_query_tx.go +++ b/ignite/cmd/node_query_tx.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui" ) func NewNodeQueryTx() *cobra.Command { diff --git a/ignite/cmd/node_tx_bank_send.go b/ignite/cmd/node_tx_bank_send.go index cf3aa101f8..f50c157cc4 100644 --- a/ignite/cmd/node_tx_bank_send.go +++ b/ignite/cmd/node_tx_bank_send.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui" ) func NewNodeTxBankSend() *cobra.Command { diff --git a/ignite/cmd/plugin.go b/ignite/cmd/plugin.go index 21078b9318..f7d4d4fb1f 100644 --- a/ignite/cmd/plugin.go +++ b/ignite/cmd/plugin.go @@ -11,13 +11,13 @@ import ( "github.com/spf13/cobra" flag "github.com/spf13/pflag" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" - "github.com/ignite/cli/ignite/pkg/clictx" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis" - "github.com/ignite/cli/ignite/pkg/xgit" - "github.com/ignite/cli/ignite/services/plugin" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" + "github.com/ignite/cli/v28/ignite/pkg/clictx" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis" + "github.com/ignite/cli/v28/ignite/pkg/xgit" + "github.com/ignite/cli/v28/ignite/services/plugin" ) const ( diff --git a/ignite/cmd/plugin_default.go b/ignite/cmd/plugin_default.go index 747f6999ba..09943e54a8 100644 --- a/ignite/cmd/plugin_default.go +++ b/ignite/cmd/plugin_default.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/services/plugin" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/services/plugin" ) type defaultPlugin struct { @@ -16,7 +16,7 @@ type defaultPlugin struct { } const ( - PluginNetworkVersion = "v0.2.0" + PluginNetworkVersion = "v0.2.1" PluginNetworkPath = "github.com/ignite/cli-plugin-network@" + PluginNetworkVersion ) diff --git a/ignite/cmd/plugin_default_test.go b/ignite/cmd/plugin_default_test.go index bf2d4a4c5e..d7b4bc0ae8 100644 --- a/ignite/cmd/plugin_default_test.go +++ b/ignite/cmd/plugin_default_test.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/assert" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" ) func TestEnsureDefaultPlugins(t *testing.T) { diff --git a/ignite/cmd/plugin_test.go b/ignite/cmd/plugin_test.go index c0e4e13eca..d3c165a7f3 100644 --- a/ignite/cmd/plugin_test.go +++ b/ignite/cmd/plugin_test.go @@ -14,9 +14,9 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" - "github.com/ignite/cli/ignite/services/plugin" - "github.com/ignite/cli/ignite/services/plugin/mocks" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" + "github.com/ignite/cli/v28/ignite/services/plugin" + "github.com/ignite/cli/v28/ignite/services/plugin/mocks" ) func buildRootCmd(ctx context.Context) *cobra.Command { diff --git a/ignite/cmd/relayer.go b/ignite/cmd/relayer.go index 4940ad1b75..66868cafb1 100644 --- a/ignite/cmd/relayer.go +++ b/ignite/cmd/relayer.go @@ -4,7 +4,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) // NewRelayer returns a new relayer command. diff --git a/ignite/cmd/relayer_configure.go b/ignite/cmd/relayer_configure.go index 10f8800aae..ee1dbd3f1c 100644 --- a/ignite/cmd/relayer_configure.go +++ b/ignite/cmd/relayer_configure.go @@ -7,12 +7,12 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cliui/cliquiz" - "github.com/ignite/cli/ignite/pkg/cliui/entrywriter" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/relayer" - relayerconfig "github.com/ignite/cli/ignite/pkg/relayer/config" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cliui/cliquiz" + "github.com/ignite/cli/v28/ignite/pkg/cliui/entrywriter" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/relayer" + relayerconfig "github.com/ignite/cli/v28/ignite/pkg/relayer/config" ) const ( diff --git a/ignite/cmd/relayer_connect.go b/ignite/cmd/relayer_connect.go index e3e2ac6079..409a5faf37 100644 --- a/ignite/cmd/relayer_connect.go +++ b/ignite/cmd/relayer_connect.go @@ -7,9 +7,9 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/relayer" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/relayer" ) // NewRelayerConnect returns a new relayer connect command to link all or some relayer paths and start diff --git a/ignite/cmd/scaffold.go b/ignite/cmd/scaffold.go index c182f72a79..3a6e0ea56a 100644 --- a/ignite/cmd/scaffold.go +++ b/ignite/cmd/scaffold.go @@ -8,13 +8,13 @@ import ( "github.com/spf13/cobra" flag "github.com/spf13/pflag" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgit" - "github.com/ignite/cli/ignite/services/scaffolder" - "github.com/ignite/cli/ignite/version" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgit" + "github.com/ignite/cli/v28/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/version" ) // flags related to component scaffolding. diff --git a/ignite/cmd/scaffold_band.go b/ignite/cmd/scaffold_band.go index ce3fce4acb..30ad5bd831 100644 --- a/ignite/cmd/scaffold_band.go +++ b/ignite/cmd/scaffold_band.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) const tplScaffoldBandSuccess = ` diff --git a/ignite/cmd/scaffold_chain.go b/ignite/cmd/scaffold_chain.go index d273da3cb5..8a7cc81940 100644 --- a/ignite/cmd/scaffold_chain.go +++ b/ignite/cmd/scaffold_chain.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) const ( diff --git a/ignite/cmd/scaffold_list.go b/ignite/cmd/scaffold_list.go index ac835e2421..21e3a8308f 100644 --- a/ignite/cmd/scaffold_list.go +++ b/ignite/cmd/scaffold_list.go @@ -3,7 +3,7 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) // NewScaffoldList returns a new command to scaffold a list. diff --git a/ignite/cmd/scaffold_map.go b/ignite/cmd/scaffold_map.go index 5d20479deb..6e78833804 100644 --- a/ignite/cmd/scaffold_map.go +++ b/ignite/cmd/scaffold_map.go @@ -3,7 +3,7 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) const ( diff --git a/ignite/cmd/scaffold_message.go b/ignite/cmd/scaffold_message.go index 931960b69c..cbdd690570 100644 --- a/ignite/cmd/scaffold_message.go +++ b/ignite/cmd/scaffold_message.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) const flagSigner = "signer" diff --git a/ignite/cmd/scaffold_module.go b/ignite/cmd/scaffold_module.go index 8dc6db50ef..e953c9ab47 100644 --- a/ignite/cmd/scaffold_module.go +++ b/ignite/cmd/scaffold_module.go @@ -9,11 +9,11 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/validation" - "github.com/ignite/cli/ignite/services/scaffolder" - modulecreate "github.com/ignite/cli/ignite/templates/module/create" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/validation" + "github.com/ignite/cli/v28/ignite/services/scaffolder" + modulecreate "github.com/ignite/cli/v28/ignite/templates/module/create" ) // moduleNameKeeperAlias is a map of well known module names that have a different keeper name than the usual Keeper. diff --git a/ignite/cmd/scaffold_package.go b/ignite/cmd/scaffold_package.go index 8d3c44d573..b5c518f131 100644 --- a/ignite/cmd/scaffold_package.go +++ b/ignite/cmd/scaffold_package.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) const ( diff --git a/ignite/cmd/scaffold_query.go b/ignite/cmd/scaffold_query.go index 4c39653336..5a9b995d6c 100644 --- a/ignite/cmd/scaffold_query.go +++ b/ignite/cmd/scaffold_query.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) const ( diff --git a/ignite/cmd/scaffold_react.go b/ignite/cmd/scaffold_react.go index 8755751b70..832c156e35 100644 --- a/ignite/cmd/scaffold_react.go +++ b/ignite/cmd/scaffold_react.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cosmosgen" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" ) // NewScaffoldReact scaffolds a React app for a chain. diff --git a/ignite/cmd/scaffold_single.go b/ignite/cmd/scaffold_single.go index 1243b34f39..22d0c84386 100644 --- a/ignite/cmd/scaffold_single.go +++ b/ignite/cmd/scaffold_single.go @@ -3,7 +3,7 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) // NewScaffoldSingle returns a new command to scaffold a singleton. diff --git a/ignite/cmd/scaffold_type.go b/ignite/cmd/scaffold_type.go index f8178379b9..d126d08100 100644 --- a/ignite/cmd/scaffold_type.go +++ b/ignite/cmd/scaffold_type.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/services/scaffolder" + "github.com/ignite/cli/v28/ignite/services/scaffolder" ) // NewScaffoldType returns a new command to scaffold a type. diff --git a/ignite/cmd/scaffold_vue.go b/ignite/cmd/scaffold_vue.go index 6487964a0a..bb9b953306 100644 --- a/ignite/cmd/scaffold_vue.go +++ b/ignite/cmd/scaffold_vue.go @@ -3,9 +3,9 @@ package ignitecmd import ( "github.com/spf13/cobra" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cliui" - "github.com/ignite/cli/ignite/pkg/cosmosgen" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" ) // NewScaffoldVue scaffolds a Vue.js app for a chain. diff --git a/ignite/cmd/tools.go b/ignite/cmd/tools.go index d7eac8cbd3..803adf8ae6 100644 --- a/ignite/cmd/tools.go +++ b/ignite/cmd/tools.go @@ -6,9 +6,9 @@ import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/nodetime" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/nodetime" ) // NewTools returns a command where various tools (binaries) are attached as sub commands diff --git a/ignite/cmd/version.go b/ignite/cmd/version.go index ed65f8013f..f61136bd58 100644 --- a/ignite/cmd/version.go +++ b/ignite/cmd/version.go @@ -3,7 +3,7 @@ package ignitecmd import ( "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/version" + "github.com/ignite/cli/v28/ignite/version" ) // NewVersion creates a new version command to show the Ignite CLI version. diff --git a/ignite/config/chain/base/config.go b/ignite/config/chain/base/config.go index b3f5c1211c..98149679fa 100644 --- a/ignite/config/chain/base/config.go +++ b/ignite/config/chain/base/config.go @@ -3,8 +3,8 @@ package base import ( "github.com/imdario/mergo" - "github.com/ignite/cli/ignite/config/chain/version" - xyaml "github.com/ignite/cli/ignite/pkg/yaml" + "github.com/ignite/cli/v28/ignite/config/chain/version" + xyaml "github.com/ignite/cli/v28/ignite/pkg/yaml" ) var ( diff --git a/ignite/config/chain/config.go b/ignite/config/chain/config.go index 3724442cbf..189f7b9765 100644 --- a/ignite/config/chain/config.go +++ b/ignite/config/chain/config.go @@ -9,9 +9,9 @@ import ( "gopkg.in/yaml.v2" - v0 "github.com/ignite/cli/ignite/config/chain/v0" - v1 "github.com/ignite/cli/ignite/config/chain/v1" - "github.com/ignite/cli/ignite/config/chain/version" + v0 "github.com/ignite/cli/v28/ignite/config/chain/v0" + v1 "github.com/ignite/cli/v28/ignite/config/chain/v1" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) var ( diff --git a/ignite/config/chain/config_test.go b/ignite/config/chain/config_test.go index 651b329143..1313c28344 100644 --- a/ignite/config/chain/config_test.go +++ b/ignite/config/chain/config_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/config/chain/version" + "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) func TestCheckVersion(t *testing.T) { diff --git a/ignite/config/chain/convert.go b/ignite/config/chain/convert.go index 7cd02b99d3..6a3845355c 100644 --- a/ignite/config/chain/convert.go +++ b/ignite/config/chain/convert.go @@ -5,7 +5,7 @@ import ( "gopkg.in/yaml.v2" - "github.com/ignite/cli/ignite/config/chain/version" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) // Build time check for the latest config version type. diff --git a/ignite/config/chain/convert_test.go b/ignite/config/chain/convert_test.go index 3b431bd58d..6901e82c5c 100644 --- a/ignite/config/chain/convert_test.go +++ b/ignite/config/chain/convert_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/require" - chainconfig "github.com/ignite/cli/ignite/config/chain" - v0testdata "github.com/ignite/cli/ignite/config/chain/v0/testdata" - "github.com/ignite/cli/ignite/config/testdata" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + v0testdata "github.com/ignite/cli/v28/ignite/config/chain/v0/testdata" + "github.com/ignite/cli/v28/ignite/config/testdata" ) func TestConvertLatest(t *testing.T) { diff --git a/ignite/config/chain/errors.go b/ignite/config/chain/errors.go index b3f43ed551..7bb981dda7 100644 --- a/ignite/config/chain/errors.go +++ b/ignite/config/chain/errors.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/ignite/cli/ignite/config/chain/version" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) // ErrConfigNotFound indicates that the config.yml can't be found. diff --git a/ignite/config/chain/network/testdata/testdata.go b/ignite/config/chain/network/testdata/testdata.go index e8d3c186c2..f9c51b9f3f 100644 --- a/ignite/config/chain/network/testdata/testdata.go +++ b/ignite/config/chain/network/testdata/testdata.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" - v1 "github.com/ignite/cli/ignite/config/chain/v1" + v1 "github.com/ignite/cli/v28/ignite/config/chain/v1" ) //go:embed config.yaml diff --git a/ignite/config/chain/parse.go b/ignite/config/chain/parse.go index 8046059d1d..41af2efd08 100644 --- a/ignite/config/chain/parse.go +++ b/ignite/config/chain/parse.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/bech32" "gopkg.in/yaml.v2" - "github.com/ignite/cli/ignite/config/chain/version" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) // Parse reads a config file. diff --git a/ignite/config/chain/parse_test.go b/ignite/config/chain/parse_test.go index 3a15d69b84..041eff238c 100644 --- a/ignite/config/chain/parse_test.go +++ b/ignite/config/chain/parse_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/require" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/config/chain/version" - "github.com/ignite/cli/ignite/config/testdata" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/config/chain/version" + "github.com/ignite/cli/v28/ignite/config/testdata" ) func TestReadConfigVersion(t *testing.T) { diff --git a/ignite/config/chain/v0/config.go b/ignite/config/chain/v0/config.go index b24de8e6da..335c5a41ac 100644 --- a/ignite/config/chain/v0/config.go +++ b/ignite/config/chain/v0/config.go @@ -6,8 +6,8 @@ import ( "github.com/imdario/mergo" "gopkg.in/yaml.v2" - "github.com/ignite/cli/ignite/config/chain/base" - "github.com/ignite/cli/ignite/config/chain/version" + "github.com/ignite/cli/v28/ignite/config/chain/base" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) // Config is the user given configuration to do additional setup during serve. diff --git a/ignite/config/chain/v0/config_convert.go b/ignite/config/chain/v0/config_convert.go index 7719dc087b..4000778184 100644 --- a/ignite/config/chain/v0/config_convert.go +++ b/ignite/config/chain/v0/config_convert.go @@ -1,8 +1,8 @@ package v0 import ( - v1 "github.com/ignite/cli/ignite/config/chain/v1" - "github.com/ignite/cli/ignite/config/chain/version" + v1 "github.com/ignite/cli/v28/ignite/config/chain/v1" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) // ConvertNext converts the current config version to the next one. diff --git a/ignite/config/chain/v0/config_convert_test.go b/ignite/config/chain/v0/config_convert_test.go index eb7c8d1c03..2744b3078d 100644 --- a/ignite/config/chain/v0/config_convert_test.go +++ b/ignite/config/chain/v0/config_convert_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/require" - v0testdata "github.com/ignite/cli/ignite/config/chain/v0/testdata" - v1 "github.com/ignite/cli/ignite/config/chain/v1" - "github.com/ignite/cli/ignite/config/chain/version" + v0testdata "github.com/ignite/cli/v28/ignite/config/chain/v0/testdata" + v1 "github.com/ignite/cli/v28/ignite/config/chain/v1" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) func TestV0ToV1(t *testing.T) { diff --git a/ignite/config/chain/v0/config_test.go b/ignite/config/chain/v0/config_test.go index b043994841..2726f4e0ea 100644 --- a/ignite/config/chain/v0/config_test.go +++ b/ignite/config/chain/v0/config_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - v0 "github.com/ignite/cli/ignite/config/chain/v0" + v0 "github.com/ignite/cli/v28/ignite/config/chain/v0" ) func TestClone(t *testing.T) { diff --git a/ignite/config/chain/v0/testdata/testdata.go b/ignite/config/chain/v0/testdata/testdata.go index 9854d79da0..cae8dce102 100644 --- a/ignite/config/chain/v0/testdata/testdata.go +++ b/ignite/config/chain/v0/testdata/testdata.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" - v0 "github.com/ignite/cli/ignite/config/chain/v0" + v0 "github.com/ignite/cli/v28/ignite/config/chain/v0" ) //go:embed config.yaml diff --git a/ignite/config/chain/v1/config.go b/ignite/config/chain/v1/config.go index 7d74186a91..e4ee36a7db 100644 --- a/ignite/config/chain/v1/config.go +++ b/ignite/config/chain/v1/config.go @@ -6,9 +6,9 @@ import ( "github.com/imdario/mergo" "gopkg.in/yaml.v2" - "github.com/ignite/cli/ignite/config/chain/base" - "github.com/ignite/cli/ignite/config/chain/version" - "github.com/ignite/cli/ignite/pkg/xnet" + "github.com/ignite/cli/v28/ignite/config/chain/base" + "github.com/ignite/cli/v28/ignite/config/chain/version" + "github.com/ignite/cli/v28/ignite/pkg/xnet" ) // DefaultConfig returns a config with default values. diff --git a/ignite/config/chain/v1/config_convert.go b/ignite/config/chain/v1/config_convert.go index 135fd05f9a..0e4bdac3cf 100644 --- a/ignite/config/chain/v1/config_convert.go +++ b/ignite/config/chain/v1/config_convert.go @@ -1,7 +1,7 @@ package v1 import ( - "github.com/ignite/cli/ignite/config/chain/version" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) // ConvertNext implements the conversion of the current config to the next version. diff --git a/ignite/config/chain/v1/config_test.go b/ignite/config/chain/v1/config_test.go index 00314d41b4..02538f06b7 100644 --- a/ignite/config/chain/v1/config_test.go +++ b/ignite/config/chain/v1/config_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/config/chain/base" - v1 "github.com/ignite/cli/ignite/config/chain/v1" - "github.com/ignite/cli/ignite/pkg/xnet" + "github.com/ignite/cli/v28/ignite/config/chain/base" + v1 "github.com/ignite/cli/v28/ignite/config/chain/v1" + "github.com/ignite/cli/v28/ignite/pkg/xnet" ) func TestConfigDecode(t *testing.T) { diff --git a/ignite/config/chain/v1/testdata/testdata.go b/ignite/config/chain/v1/testdata/testdata.go index e8d3c186c2..f9c51b9f3f 100644 --- a/ignite/config/chain/v1/testdata/testdata.go +++ b/ignite/config/chain/v1/testdata/testdata.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" - v1 "github.com/ignite/cli/ignite/config/chain/v1" + v1 "github.com/ignite/cli/v28/ignite/config/chain/v1" ) //go:embed config.yaml diff --git a/ignite/config/chain/v1/validator.go b/ignite/config/chain/v1/validator.go index bfeb1fffd0..7af0b615c5 100644 --- a/ignite/config/chain/v1/validator.go +++ b/ignite/config/chain/v1/validator.go @@ -1,7 +1,7 @@ package v1 import ( - xyaml "github.com/ignite/cli/ignite/pkg/yaml" + xyaml "github.com/ignite/cli/v28/ignite/pkg/yaml" ) // Validator holds info related to validator settings. diff --git a/ignite/config/chain/v1/validator_servers.go b/ignite/config/chain/v1/validator_servers.go index 6682d8abb1..cfb464859e 100644 --- a/ignite/config/chain/v1/validator_servers.go +++ b/ignite/config/chain/v1/validator_servers.go @@ -5,7 +5,7 @@ import ( "github.com/mitchellh/mapstructure" - baseconfig "github.com/ignite/cli/ignite/config/chain/base" + baseconfig "github.com/ignite/cli/v28/ignite/config/chain/base" ) func DefaultServers() Servers { diff --git a/ignite/config/chain/v1/validator_servers_test.go b/ignite/config/chain/v1/validator_servers_test.go index ac49b00622..c711f43603 100644 --- a/ignite/config/chain/v1/validator_servers_test.go +++ b/ignite/config/chain/v1/validator_servers_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - v1 "github.com/ignite/cli/ignite/config/chain/v1" - xyaml "github.com/ignite/cli/ignite/pkg/yaml" + v1 "github.com/ignite/cli/v28/ignite/config/chain/v1" + xyaml "github.com/ignite/cli/v28/ignite/pkg/yaml" ) func TestValidatorGetServers(t *testing.T) { diff --git a/ignite/config/config.go b/ignite/config/config.go index 44a5c4ff2b..39cc87203e 100644 --- a/ignite/config/config.go +++ b/ignite/config/config.go @@ -1,8 +1,8 @@ package config import ( - "github.com/ignite/cli/ignite/pkg/env" - "github.com/ignite/cli/ignite/pkg/xfilepath" + "github.com/ignite/cli/v28/ignite/pkg/env" + "github.com/ignite/cli/v28/ignite/pkg/xfilepath" ) // DirPath returns the path of configuration directory of Ignite. diff --git a/ignite/config/plugins/config.go b/ignite/config/plugins/config.go index 8b386a2d9b..6b0477e292 100644 --- a/ignite/config/plugins/config.go +++ b/ignite/config/plugins/config.go @@ -9,7 +9,7 @@ import ( "golang.org/x/exp/slices" "gopkg.in/yaml.v2" - "github.com/ignite/cli/ignite/pkg/gomodule" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" ) type Config struct { diff --git a/ignite/config/plugins/config_test.go b/ignite/config/plugins/config_test.go index 5986efe8ad..10a463f4b6 100644 --- a/ignite/config/plugins/config_test.go +++ b/ignite/config/plugins/config_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" ) func TestPluginIsGlobal(t *testing.T) { diff --git a/ignite/config/plugins/parse_test.go b/ignite/config/plugins/parse_test.go index abe7558e3a..30e1904ad0 100644 --- a/ignite/config/plugins/parse_test.go +++ b/ignite/config/plugins/parse_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" ) func TestParseDir(t *testing.T) { diff --git a/ignite/config/testdata/testdata.go b/ignite/config/testdata/testdata.go index 530635984f..d5602c4015 100644 --- a/ignite/config/testdata/testdata.go +++ b/ignite/config/testdata/testdata.go @@ -3,11 +3,11 @@ package testdata import ( "testing" - chainconfig "github.com/ignite/cli/ignite/config/chain" - networkconfigTestdata "github.com/ignite/cli/ignite/config/chain/network/testdata" - v0testdata "github.com/ignite/cli/ignite/config/chain/v0/testdata" - v1testdata "github.com/ignite/cli/ignite/config/chain/v1/testdata" - "github.com/ignite/cli/ignite/config/chain/version" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + networkconfigTestdata "github.com/ignite/cli/v28/ignite/config/chain/network/testdata" + v0testdata "github.com/ignite/cli/v28/ignite/config/chain/v0/testdata" + v1testdata "github.com/ignite/cli/v28/ignite/config/chain/v1/testdata" + "github.com/ignite/cli/v28/ignite/config/chain/version" ) var Versions = map[version.Version][]byte{ diff --git a/ignite/internal/analytics/analytics.go b/ignite/internal/analytics/analytics.go index 6bc8367caa..abc57802ba 100644 --- a/ignite/internal/analytics/analytics.go +++ b/ignite/internal/analytics/analytics.go @@ -9,10 +9,11 @@ import ( "sync" "github.com/manifoldco/promptui" + "github.com/spf13/cobra" - "github.com/ignite/cli/ignite/pkg/gacli" - "github.com/ignite/cli/ignite/pkg/randstr" - "github.com/ignite/cli/ignite/version" + "github.com/ignite/cli/v28/ignite/pkg/gacli" + "github.com/ignite/cli/v28/ignite/pkg/randstr" + "github.com/ignite/cli/v28/ignite/version" ) const ( @@ -24,50 +25,21 @@ const ( var gaclient gacli.Client -type ( - // metric represents an analytics metric. - options struct { - // err sets metrics type as an error metric. - err error - } - - // anonIdentity represents an analytics identity file. - anonIdentity struct { - // name represents the username. - Name string `json:"name" yaml:"name"` - // doNotTrack represents the user track choice. - DoNotTrack bool `json:"doNotTrack" yaml:"doNotTrack"` - } -) +// anonIdentity represents an analytics identity file. +type anonIdentity struct { + // name represents the username. + Name string `json:"name" yaml:"name"` + // doNotTrack represents the user track choice. + DoNotTrack bool `json:"doNotTrack" yaml:"doNotTrack"` +} func init() { gaclient = gacli.New(telemetryEndpoint) } -// Option configures ChainCmd. -type Option func(*options) - -// WithError with application command error. -func WithError(error error) Option { - return func(m *options) { - m.err = error - } -} - // SendMetric send command metrics to analytics. -func SendMetric(wg *sync.WaitGroup, args []string, opts ...Option) { - // only the app name - if len(args) <= 1 { - return - } - - // apply analytics options. - var opt options - for _, o := range opts { - o(&opt) - } - - if args[1] == "version" { +func SendMetric(wg *sync.WaitGroup, cmd *cobra.Command) { + if cmd.Name() == "version" { return } @@ -76,23 +48,17 @@ func SendMetric(wg *sync.WaitGroup, args []string, opts ...Option) { return } + path := cmd.CommandPath() met := gacli.Metric{ + Name: cmd.Name(), + Cmd: path, + Tag: strings.ReplaceAll(path, " ", "+"), OS: runtime.GOOS, Arch: runtime.GOARCH, - FullCmd: strings.Join(args[1:], " "), SessionID: dntInfo.Name, Version: version.Version, } - switch { - case opt.err == nil: - met.Status = "success" - case opt.err != nil: - met.Status = "error" - met.Error = opt.err.Error() - } - met.Cmd = args[1] - wg.Add(1) go func() { defer wg.Done() @@ -130,10 +96,12 @@ func checkDNT() (anonIdentity, error) { i.DoNotTrack = false prompt := promptui.Select{ - Label: "Ignite collects metrics about command usage. " + - "All data is anonymous and helps to improve Ignite. " + - "Ignite respect the DNT rules (consoledonottrack.com). " + - "Would you agree to share these metrics with us?", + Label: "Ignite uses anonymized metrics to enhance the application, " + + "focusing on features such as command usage. We do not collect " + + "identifiable personal information. Your privacy is important to us. " + + "For more details, please visit our Privacy Policy at https://ignite.com/privacy " + + "and our Terms of Use at https://ignite.com/terms-of-use. " + + "Do you consent to the collection of these usage metrics for analytics purposes?", Items: []string{"Yes", "No"}, } resultID, _, err := prompt.Run() diff --git a/ignite/internal/tools/gen-cli-docs/main.go b/ignite/internal/tools/gen-cli-docs/main.go index 0768131bf3..bc0f1e8660 100644 --- a/ignite/internal/tools/gen-cli-docs/main.go +++ b/ignite/internal/tools/gen-cli-docs/main.go @@ -17,10 +17,10 @@ import ( "github.com/spf13/cobra" "github.com/spf13/cobra/doc" - ignitecmd "github.com/ignite/cli/ignite/cmd" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" - "github.com/ignite/cli/ignite/pkg/env" - "github.com/ignite/cli/ignite/services/plugin" + ignitecmd "github.com/ignite/cli/v28/ignite/cmd" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" + "github.com/ignite/cli/v28/ignite/pkg/env" + "github.com/ignite/cli/v28/ignite/services/plugin" ) const head = `--- diff --git a/ignite/pkg/availableport/availableport_test.go b/ignite/pkg/availableport/availableport_test.go index cd42b0b6ff..12104d0217 100644 --- a/ignite/pkg/availableport/availableport_test.go +++ b/ignite/pkg/availableport/availableport_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/availableport" + "github.com/ignite/cli/v28/ignite/pkg/availableport" ) func TestFind(t *testing.T) { diff --git a/ignite/pkg/cache/cache_test.go b/ignite/pkg/cache/cache_test.go index e8643daa78..f72b403c8d 100644 --- a/ignite/pkg/cache/cache_test.go +++ b/ignite/pkg/cache/cache_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cache" ) type TestStruct struct { diff --git a/ignite/pkg/chaincmd/chaincmd.go b/ignite/pkg/chaincmd/chaincmd.go index 78d2a58f71..78789fb71a 100644 --- a/ignite/pkg/chaincmd/chaincmd.go +++ b/ignite/pkg/chaincmd/chaincmd.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" ) const ( diff --git a/ignite/pkg/chaincmd/runner/account.go b/ignite/pkg/chaincmd/runner/account.go index 6a36731614..0d6e8bc2ce 100644 --- a/ignite/pkg/chaincmd/runner/account.go +++ b/ignite/pkg/chaincmd/runner/account.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" ) var ( diff --git a/ignite/pkg/chaincmd/runner/chain.go b/ignite/pkg/chaincmd/runner/chain.go index e3e07f71c9..f1d006f11d 100644 --- a/ignite/pkg/chaincmd/runner/chain.go +++ b/ignite/pkg/chaincmd/runner/chain.go @@ -13,9 +13,9 @@ import ( "github.com/cenkalti/backoff" "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/chaincmd" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" ) // Start starts the blockchain. diff --git a/ignite/pkg/chaincmd/runner/runner.go b/ignite/pkg/chaincmd/runner/runner.go index c5a2a15139..46be78e5a1 100644 --- a/ignite/pkg/chaincmd/runner/runner.go +++ b/ignite/pkg/chaincmd/runner/runner.go @@ -10,10 +10,10 @@ import ( "github.com/pkg/errors" "sigs.k8s.io/yaml" - "github.com/ignite/cli/ignite/pkg/chaincmd" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/truncatedbuffer" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/truncatedbuffer" ) // Runner provides high level access to a blockchain's commands. diff --git a/ignite/pkg/chaincmd/runner/simulate.go b/ignite/pkg/chaincmd/runner/simulate.go index 62fd3cd440..f7de4e42c8 100644 --- a/ignite/pkg/chaincmd/runner/simulate.go +++ b/ignite/pkg/chaincmd/runner/simulate.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/ignite/cli/ignite/pkg/chaincmd" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" ) // Simulation run the chain simulation. diff --git a/ignite/pkg/chaincmd/simulate.go b/ignite/pkg/chaincmd/simulate.go index 8d4ead7df6..1d0d028a30 100644 --- a/ignite/pkg/chaincmd/simulate.go +++ b/ignite/pkg/chaincmd/simulate.go @@ -4,8 +4,8 @@ import ( "path/filepath" "strconv" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" ) const ( diff --git a/ignite/pkg/checksum/checksum.go b/ignite/pkg/checksum/checksum.go index 8342f92dc0..d7b882b2f5 100644 --- a/ignite/pkg/checksum/checksum.go +++ b/ignite/pkg/checksum/checksum.go @@ -8,7 +8,7 @@ import ( "os" "path/filepath" - "github.com/ignite/cli/ignite/pkg/xexec" + "github.com/ignite/cli/v28/ignite/pkg/xexec" ) // Sum reads files from dirPath, calculates sha256 for each file and creates a new checksum diff --git a/ignite/pkg/clictx/clictx_test.go b/ignite/pkg/clictx/clictx_test.go index bcfa1b5210..6fd6da616c 100644 --- a/ignite/pkg/clictx/clictx_test.go +++ b/ignite/pkg/clictx/clictx_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/clictx" + "github.com/ignite/cli/v28/ignite/pkg/clictx" ) func TestDo(t *testing.T) { diff --git a/ignite/pkg/cliui/cliui.go b/ignite/pkg/cliui/cliui.go index fbbc098f2e..2b624b89be 100644 --- a/ignite/pkg/cliui/cliui.go +++ b/ignite/pkg/cliui/cliui.go @@ -8,11 +8,11 @@ import ( "github.com/manifoldco/promptui" - "github.com/ignite/cli/ignite/pkg/cliui/cliquiz" - "github.com/ignite/cli/ignite/pkg/cliui/clispinner" - "github.com/ignite/cli/ignite/pkg/cliui/entrywriter" - uilog "github.com/ignite/cli/ignite/pkg/cliui/log" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/cliui/cliquiz" + "github.com/ignite/cli/v28/ignite/pkg/cliui/clispinner" + "github.com/ignite/cli/v28/ignite/pkg/cliui/entrywriter" + uilog "github.com/ignite/cli/v28/ignite/pkg/cliui/log" + "github.com/ignite/cli/v28/ignite/pkg/events" ) type sessionOptions struct { diff --git a/ignite/pkg/cliui/entrywriter/entrywriter.go b/ignite/pkg/cliui/entrywriter/entrywriter.go index 6e583be0a3..228f4aa520 100644 --- a/ignite/pkg/cliui/entrywriter/entrywriter.go +++ b/ignite/pkg/cliui/entrywriter/entrywriter.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) const ( diff --git a/ignite/pkg/cliui/entrywriter/entrywriter_test.go b/ignite/pkg/cliui/entrywriter/entrywriter_test.go index 612adf92b3..10bef4fbbf 100644 --- a/ignite/pkg/cliui/entrywriter/entrywriter_test.go +++ b/ignite/pkg/cliui/entrywriter/entrywriter_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cliui/entrywriter" + "github.com/ignite/cli/v28/ignite/pkg/cliui/entrywriter" ) type WriterWithError struct{} diff --git a/ignite/pkg/cliui/icons/icon.go b/ignite/pkg/cliui/icons/icon.go index 75495e9753..4923be4946 100644 --- a/ignite/pkg/cliui/icons/icon.go +++ b/ignite/pkg/cliui/icons/icon.go @@ -1,7 +1,7 @@ package icons import ( - "github.com/ignite/cli/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" ) var ( diff --git a/ignite/pkg/cliui/log/output.go b/ignite/pkg/cliui/log/output.go index 358b76454e..26f049643f 100644 --- a/ignite/pkg/cliui/log/output.go +++ b/ignite/pkg/cliui/log/output.go @@ -4,10 +4,10 @@ import ( "io" "os" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/lineprefixer" - "github.com/ignite/cli/ignite/pkg/cliui/prefixgen" - "github.com/ignite/cli/ignite/pkg/xio" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/lineprefixer" + "github.com/ignite/cli/v28/ignite/pkg/cliui/prefixgen" + "github.com/ignite/cli/v28/ignite/pkg/xio" ) const ( diff --git a/ignite/pkg/cliui/model/events.go b/ignite/pkg/cliui/model/events.go index 348bcfb255..82c0034507 100644 --- a/ignite/pkg/cliui/model/events.go +++ b/ignite/pkg/cliui/model/events.go @@ -9,9 +9,9 @@ import ( "github.com/charmbracelet/bubbles/spinner" tea "github.com/charmbracelet/bubbletea" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/events" ) // EventMsg defines a message for events. diff --git a/ignite/pkg/cliui/model/events_test.go b/ignite/pkg/cliui/model/events_test.go index d43efde8bc..ec1f727ddd 100644 --- a/ignite/pkg/cliui/model/events_test.go +++ b/ignite/pkg/cliui/model/events_test.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - cliuimodel "github.com/ignite/cli/ignite/pkg/cliui/model" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + cliuimodel "github.com/ignite/cli/v28/ignite/pkg/cliui/model" + "github.com/ignite/cli/v28/ignite/pkg/events" ) func TestStatusEventsView(t *testing.T) { diff --git a/ignite/pkg/cliui/prefixgen/prefixgen.go b/ignite/pkg/cliui/prefixgen/prefixgen.go index 80974131c3..4b6e3cae7f 100644 --- a/ignite/pkg/cliui/prefixgen/prefixgen.go +++ b/ignite/pkg/cliui/prefixgen/prefixgen.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/ignite/cli/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" ) // Prefixer generates prefixes. diff --git a/ignite/pkg/cliui/view/accountview/account.go b/ignite/pkg/cliui/view/accountview/account.go index 801f9a8a97..42d4379451 100644 --- a/ignite/pkg/cliui/view/accountview/account.go +++ b/ignite/pkg/cliui/view/accountview/account.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" ) var ( diff --git a/ignite/pkg/cliui/view/accountview/account_test.go b/ignite/pkg/cliui/view/accountview/account_test.go index e5cb240357..9578c8a098 100644 --- a/ignite/pkg/cliui/view/accountview/account_test.go +++ b/ignite/pkg/cliui/view/accountview/account_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/ignite/cli/ignite/pkg/cliui/view/accountview" + "github.com/ignite/cli/v28/ignite/pkg/cliui/view/accountview" ) func TestAccountString(t *testing.T) { diff --git a/ignite/pkg/cliui/view/errorview/error.go b/ignite/pkg/cliui/view/errorview/error.go index e0b4c47ef4..367fed2fb4 100644 --- a/ignite/pkg/cliui/view/errorview/error.go +++ b/ignite/pkg/cliui/view/errorview/error.go @@ -5,7 +5,7 @@ import ( "github.com/muesli/reflow/wordwrap" - "github.com/ignite/cli/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" ) func NewError(err error) Error { diff --git a/ignite/pkg/cmdrunner/cmdrunner.go b/ignite/pkg/cmdrunner/cmdrunner.go index 7f33b56d83..84c2c3b913 100644 --- a/ignite/pkg/cmdrunner/cmdrunner.go +++ b/ignite/pkg/cmdrunner/cmdrunner.go @@ -10,9 +10,9 @@ import ( "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/env" - "github.com/ignite/cli/ignite/pkg/goenv" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/env" + "github.com/ignite/cli/v28/ignite/pkg/goenv" ) // Runner is an object to run commands. diff --git a/ignite/pkg/cmdrunner/exec/exec.go b/ignite/pkg/cmdrunner/exec/exec.go index f675400dac..d71e851812 100644 --- a/ignite/pkg/cmdrunner/exec/exec.go +++ b/ignite/pkg/cmdrunner/exec/exec.go @@ -10,8 +10,8 @@ import ( "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" ) // ExitError is an alias to exec.ExitError. diff --git a/ignite/pkg/cosmosaccount/cosmosaccount_test.go b/ignite/pkg/cosmosaccount/cosmosaccount_test.go index ec07b6d87b..8a66e1ff3d 100644 --- a/ignite/pkg/cosmosaccount/cosmosaccount_test.go +++ b/ignite/pkg/cosmosaccount/cosmosaccount_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) const testAccountName = "myTestAccount" diff --git a/ignite/pkg/cosmosanalysis/app/app.go b/ignite/pkg/cosmosanalysis/app/app.go index 41f284e4e2..cc2f7b85da 100644 --- a/ignite/pkg/cosmosanalysis/app/app.go +++ b/ignite/pkg/cosmosanalysis/app/app.go @@ -1,19 +1,25 @@ package app import ( + "context" + "errors" "fmt" "go/ast" "go/parser" "go/token" + "os" "path/filepath" "strings" - "github.com/ignite/cli/ignite/pkg/goanalysis" - "github.com/ignite/cli/ignite/pkg/xast" - - "github.com/ignite/cli/ignite/pkg/cosmosanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/goanalysis" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" + "github.com/ignite/cli/v28/ignite/pkg/xast" ) +const registerRoutesMethod = "RegisterAPIRoutes" + // CheckKeeper checks for the existence of the keeper with the provided name in the app structure. func CheckKeeper(path, keeperName string) error { // find app type @@ -84,58 +90,37 @@ func FindRegisteredModules(chainRoot string) ([]string, error) { return nil, err } - // Loop on package's files - var blankImports []string + // Search the app for the imported SDK modules var discovered []string for _, f := range appPkg.Files { - blankImports = append(blankImports, goanalysis.FindBlankImports(f)...) + discovered = append(discovered, goanalysis.FindBlankImports(f)...) fileImports := goanalysis.FormatImports(f) - d, err := FindKeepersModules(f, fileImports) + d, err := DiscoverModules(f, chainRoot, fileImports) if err != nil { return nil, err } discovered = append(discovered, d...) } - return mergeImports(blankImports, discovered), nil -} -// mergeImports merge all discovered imports into the blank imports found in the app files. -func mergeImports(blankImports, discovered []string) []string { - imports := make([]string, len(blankImports)) - copy(imports, blankImports) - for i, m := range discovered { - split := strings.Split(m, "/") - - j := len(split) - maxTrim := len(split) - 3 - LoopBack: - for j > maxTrim { - j-- - // x path means we are reaching the root of the module - if split[j] == "x" { - j = maxTrim - goto LoopBack - } - for _, imp := range blankImports { - // check if the import exist into the blank imports - if strings.Contains(imp, m) { - j = -1 - goto LoopBack - } - } - m = strings.TrimSuffix(m, "/"+split[j]) - } - if j == maxTrim { - imports = append(imports, discovered[i]) + // Discover IBC wired modules + // TODO: This can be removed once IBC modules use dependency injection + ibcPath := filepath.Join(chainRoot, "app", "ibc.go") + if _, err := os.Stat(ibcPath); err == nil { + m, err := discoverIBCModules(ibcPath) + if err != nil { + return nil, err } + + discovered = append(discovered, m...) } - return imports + + return removeDuplicateEntries(discovered), nil } -// FindKeepersModules find a map of import modules based on the keepers params on the App struct. -func FindKeepersModules(n ast.Node, fileImports map[string]string) ([]string, error) { +// DiscoverModules find a map of import modules based on the configured app. +func DiscoverModules(file *ast.File, chainRoot string, fileImports map[string]string) ([]string, error) { // find app type - appImpl := cosmosanalysis.FindImplementationInFile(n, cosmosanalysis.AppImplementation) + appImpl := cosmosanalysis.FindImplementationInFile(file, cosmosanalysis.AppImplementation) appTypeName := "App" switch { case len(appImpl) > 1: @@ -144,63 +129,245 @@ func FindKeepersModules(n ast.Node, fileImports map[string]string) ([]string, er appTypeName = appImpl[0] } - file, ok := n.(*ast.File) - if !ok { - return nil, nil + var discovered []string + for _, decl := range file.Decls { + switch x := decl.(type) { + case *ast.GenDecl: + discovered = append(discovered, discoverKeeperModules(x, appTypeName, fileImports)...) + case *ast.FuncDecl: + // The modules registered by Cosmos SDK `rumtime.App` are included + // when the app registers API modules though the `App` instance. + if isRuntimeAppCalled(x) { + m, err := discoverRuntimeAppModules(chainRoot) + if err != nil { + return nil, err + } + discovered = append(discovered, m...) + } + } + } + return removeDuplicateEntries(discovered), nil +} + +func removeDuplicateEntries(entries []string) (res []string) { + seen := make(map[string]struct{}) + for _, e := range entries { + if _, ok := seen[e]; ok { + continue + } + + seen[e] = struct{}{} + res = append(res, e) } + return +} - keeperParamsMap := make(map[string]struct{}) - for _, decl := range file.Decls { - genDecl, ok := decl.(*ast.GenDecl) +func discoverKeeperModules(d *ast.GenDecl, appTypeName string, imports map[string]string) []string { + var modules []string + for _, spec := range d.Specs { + typeSpec, ok := spec.(*ast.TypeSpec) + if !ok { + continue + } + if typeSpec.Name.Name != appTypeName { + continue + } + structType, ok := typeSpec.Type.(*ast.StructType) if !ok { continue } - for _, spec := range genDecl.Specs { - typeSpec, ok := spec.(*ast.TypeSpec) - if !ok { + for _, field := range structType.Fields.List { + f := field.Type + CheckSpec: + switch spec := f.(type) { + case *ast.StarExpr: + f, ok = spec.X.(*ast.SelectorExpr) + if !ok { + continue + } + goto CheckSpec + case *ast.SelectorExpr: + if !strings.HasSuffix(spec.Sel.Name, "Keeper") { + continue + } + ident, ok := spec.X.(*ast.Ident) + if !ok { + continue + } + fileImport, ok := imports[ident.Name] + if !ok { + continue + } + modules = append(modules, removeKeeperPkgPath(fileImport)) + } + } + } + return modules +} + +func discoverRuntimeAppModules(chainRoot string) ([]string, error) { + // Resolve the absolute path to the Cosmos SDK module + cosmosPath, err := resolveCosmosPackagePath(chainRoot) + if err != nil { + return nil, err + } + + var modules []string + + // When runtime package doesn't exists it means is an older Cosmos SDK version, + // so all the module API registrations are defined within user's app. + path := filepath.Join(cosmosPath, "runtime", "app.go") + if _, err := os.Stat(path); os.IsNotExist(err) { + return modules, nil + } + + f, _, err := xast.ParseFile(path) + if err != nil { + return nil, err + } + + imports := goanalysis.FormatImports(f) + err = xast.Inspect(f, func(n ast.Node) error { + if pkgs := findRegisterAPIRoutesRegistrations(n); pkgs != nil { + for _, p := range pkgs { + if m := imports[p]; m != "" { + modules = append(modules, m) + } + } + return xast.ErrStop + } + return nil + }) + + if err != nil { + return nil, err + } + return modules, nil +} + +func discoverIBCModules(ibcPath string) ([]string, error) { + f, _, err := xast.ParseFile(ibcPath) + if err != nil { + return nil, err + } + + var ( + names []string + imports = goanalysis.FormatImports(f) + ) + err = xast.Inspect(f, func(n ast.Node) error { + fn, _ := n.(*ast.FuncDecl) + if fn == nil { + return nil + } + + if fn.Name.Name != "AddIBCModuleManager" { + return nil + } + + for _, stmt := range fn.Body.List { + x, _ := stmt.(*ast.AssignStmt) + if x == nil { + continue + } + + if len(x.Rhs) == 0 { continue } - if typeSpec.Name.Name != appTypeName { + + c, _ := x.Rhs[0].(*ast.CompositeLit) + if c == nil { continue } - structType, ok := typeSpec.Type.(*ast.StructType) - if !ok { + + s, _ := c.Type.(*ast.SelectorExpr) + if s == nil || s.Sel.Name != "AppModule" { continue } - for _, field := range structType.Fields.List { - f := field.Type - CheckSpec: - switch spec := f.(type) { - case *ast.StarExpr: - f, ok = spec.X.(*ast.SelectorExpr) - if !ok { - continue - } - goto CheckSpec - case *ast.SelectorExpr: - if !strings.HasSuffix(spec.Sel.Name, "Keeper") { - continue - } - ident, ok := spec.X.(*ast.Ident) - if !ok { - continue - } - fileImport, ok := fileImports[ident.Name] - if !ok { - continue - } - keeperParamsMap[removeKeeperPkgPath(fileImport)] = struct{}{} - } + + if m, _ := s.X.(*ast.Ident); m != nil { + names = append(names, m.Name) } } + + return xast.ErrStop + }) + if err != nil { + return nil, err + } + + var modules []string + for _, n := range names { + modules = append(modules, imports[n]) + } + return modules, nil +} + +func resolveCosmosPackagePath(chainRoot string) (string, error) { + modFile, err := gomodule.ParseAt(chainRoot) + if err != nil { + return "", err + } + + deps, err := gomodule.ResolveDependencies(modFile, false) + if err != nil { + return "", err + } + + var pkg string + for _, dep := range deps { + if dep.Path == cosmosver.CosmosModulePath { + pkg = dep.String() + break + } } - keeperParams := make([]string, 0) - for param := range keeperParamsMap { - keeperParams = append(keeperParams, param) + if pkg == "" { + return "", errors.New("cosmos SDK package version not found") } - return keeperParams, nil + m, err := gomodule.FindModule(context.Background(), chainRoot, pkg) + if err != nil { + return "", err + } + return m.Dir, nil +} + +func findRegisterAPIRoutesRegistrations(n ast.Node) []string { + funcLitType, ok := n.(*ast.FuncDecl) + if !ok { + return nil + } + + if funcLitType.Name.Name != registerRoutesMethod { + return nil + } + + var packagesRegistered []string + for _, stmt := range funcLitType.Body.List { + exprStmt, ok := stmt.(*ast.ExprStmt) + if !ok { + continue + } + exprCall, ok := exprStmt.X.(*ast.CallExpr) + if !ok { + continue + } + exprFun, ok := exprCall.Fun.(*ast.SelectorExpr) + if !ok || exprFun.Sel.Name != "RegisterGRPCGatewayRoutes" { + continue + } + identType, ok := exprFun.X.(*ast.Ident) + if !ok { + continue + } + pkgName := identType.Name + if pkgName == "" { + continue + } + packagesRegistered = append(packagesRegistered, identType.Name) + } + return packagesRegistered } func removeKeeperPkgPath(pkg string) string { @@ -208,3 +375,40 @@ func removeKeeperPkgPath(pkg string) string { path = strings.TrimSuffix(path, "/controller") return strings.TrimSuffix(path, "/host") } + +func isRuntimeAppCalled(fn *ast.FuncDecl) bool { + if fn.Name.Name != registerRoutesMethod { + return false + } + + for _, stmt := range fn.Body.List { + exprStmt, ok := stmt.(*ast.ExprStmt) + if !ok { + continue + } + + exprCall, ok := exprStmt.X.(*ast.CallExpr) + if !ok { + continue + } + + exprFun, ok := exprCall.Fun.(*ast.SelectorExpr) + if !ok || exprFun.Sel.Name != registerRoutesMethod { + continue + } + + exprSel, ok := exprFun.X.(*ast.SelectorExpr) + if !ok || exprSel.Sel.Name != "App" { + continue + } + + identType, ok := exprSel.X.(*ast.Ident) + if !ok || identType.Name != "app" { + continue + } + + return true + } + + return false +} diff --git a/ignite/pkg/cosmosanalysis/app/app_test.go b/ignite/pkg/cosmosanalysis/app/app_test.go index 35545e3959..3638950b0e 100644 --- a/ignite/pkg/cosmosanalysis/app/app_test.go +++ b/ignite/pkg/cosmosanalysis/app/app_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/goanalysis" - "github.com/ignite/cli/ignite/pkg/xast" + "github.com/ignite/cli/v28/ignite/pkg/goanalysis" + "github.com/ignite/cli/v28/ignite/pkg/xast" ) var ( @@ -85,6 +85,9 @@ func TestFindRegisteredModules(t *testing.T) { "github.com/cosmos/cosmos-sdk/x/staking", "github.com/cosmos/cosmos-sdk/x/gov", "github.com/username/test/x/foo", + "github.com/cosmos/cosmos-sdk/x/auth/tx", + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", + "github.com/cosmos/cosmos-sdk/client/grpc/node", } cases := []struct { @@ -110,6 +113,8 @@ func TestFindRegisteredModules(t *testing.T) { "cosmossdk.io/x/evidence", "cosmossdk.io/x/feegrant/module", "cosmossdk.io/x/upgrade", + "github.com/cosmos/cosmos-sdk/x/auth", + "github.com/cosmos/cosmos-sdk/x/auth/tx", "github.com/cosmos/cosmos-sdk/x/auth/tx/config", "github.com/cosmos/cosmos-sdk/x/auth/vesting", "github.com/cosmos/cosmos-sdk/x/authz/module", @@ -125,6 +130,8 @@ func TestFindRegisteredModules(t *testing.T) { "github.com/ignite/mars/x/mars", "github.com/cosmos/cosmos-sdk/x/gov", "github.com/username/test/x/foo", + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", + "github.com/cosmos/cosmos-sdk/client/grpc/node", }, }, { @@ -191,6 +198,9 @@ func TestFindRegisteredModules(t *testing.T) { path: "testdata/modules/spn", expectedModules: []string{ "github.com/cosmos/cosmos-sdk/x/auth", + "github.com/cosmos/cosmos-sdk/x/auth/tx", + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", + "github.com/cosmos/cosmos-sdk/client/grpc/node", "github.com/cosmos/cosmos-sdk/x/bank", "github.com/cosmos/cosmos-sdk/x/capability", "github.com/cosmos/cosmos-sdk/x/staking", @@ -239,6 +249,9 @@ func TestFindRegisteredModules(t *testing.T) { "github.com/cosmos/cosmos-sdk/x/authz", "github.com/CosmWasm/wasmd/x/wasm", "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts", + "github.com/cosmos/cosmos-sdk/x/auth/tx", + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", + "github.com/cosmos/cosmos-sdk/client/grpc/node", }, }, } @@ -252,13 +265,16 @@ func TestFindRegisteredModules(t *testing.T) { } } -func TestFindKeepersModules(t *testing.T) { +func TestDiscoverModules(t *testing.T) { basicModules := []string{ "github.com/cosmos/cosmos-sdk/x/auth", "github.com/cosmos/cosmos-sdk/x/bank", "github.com/cosmos/cosmos-sdk/x/staking", "github.com/cosmos/cosmos-sdk/x/gov", "github.com/username/test/x/foo", + "github.com/cosmos/cosmos-sdk/x/auth/tx", + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", + "github.com/cosmos/cosmos-sdk/client/grpc/node", } cases := []struct { @@ -343,6 +359,9 @@ func TestFindKeepersModules(t *testing.T) { path: "testdata/modules/spn", expectedModules: []string{ "github.com/cosmos/cosmos-sdk/x/auth", + "github.com/cosmos/cosmos-sdk/x/auth/tx", + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", + "github.com/cosmos/cosmos-sdk/client/grpc/node", "github.com/cosmos/cosmos-sdk/x/bank", "github.com/cosmos/cosmos-sdk/x/capability", "github.com/cosmos/cosmos-sdk/x/staking", @@ -391,6 +410,9 @@ func TestFindKeepersModules(t *testing.T) { "github.com/cosmos/cosmos-sdk/x/authz", "github.com/CosmWasm/wasmd/x/wasm", "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts", + "github.com/cosmos/cosmos-sdk/x/auth/tx", + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice", + "github.com/cosmos/cosmos-sdk/client/grpc/node", }, }, } @@ -403,7 +425,7 @@ func TestFindKeepersModules(t *testing.T) { got := make([]string, 0) for _, f := range appPkg.Files { fileImports := goanalysis.FormatImports(f) - modules, err := FindKeepersModules(f, fileImports) + modules, err := DiscoverModules(f, tt.path, fileImports) require.NoError(t, err) if modules != nil { got = append(got, modules...) @@ -414,122 +436,6 @@ func TestFindKeepersModules(t *testing.T) { } } -func Test_mergeImports(t *testing.T) { - tests := []struct { - name string - blankImports []string - discovered []string - want []string - }{ - { - name: "test nil imports", - blankImports: nil, - discovered: nil, - want: nil, - }, - { - name: "test empty imports", - blankImports: []string{}, - discovered: []string{}, - want: []string{}, - }, - { - name: "test only one blank import", - blankImports: []string{"github.com/cosmos/cosmos-sdk/x/auth"}, - discovered: []string{}, - want: []string{"github.com/cosmos/cosmos-sdk/x/auth"}, - }, - { - name: "test only one discovered import", - blankImports: []string{}, - discovered: []string{"github.com/cosmos/cosmos-sdk/x/auth"}, - want: []string{"github.com/cosmos/cosmos-sdk/x/auth"}, - }, - { - name: "test only one import", - blankImports: []string{"github.com/cosmos/cosmos-sdk/x/auth"}, - discovered: []string{"github.com/cosmos/cosmos-sdk/x/auth/keeper"}, - want: []string{"github.com/cosmos/cosmos-sdk/x/auth"}, - }, - { - name: "test only one keeper import", - blankImports: []string{"github.com/cosmos/cosmos-sdk/x/auth/module"}, - discovered: []string{"github.com/cosmos/cosmos-sdk/x/auth/keeper"}, - want: []string{"github.com/cosmos/cosmos-sdk/x/auth/module"}, - }, - { - name: "test two keeper import", - blankImports: []string{ - "github.com/cosmos/cosmos-sdk/x/auth/module", - "github.com/cosmos/cosmos-sdk/x/bank/module", - }, - discovered: []string{ - "github.com/cosmos/cosmos-sdk/x/auth/keeper", - "github.com/cosmos/cosmos-sdk/x/bank/keeper", - }, - want: []string{ - "github.com/cosmos/cosmos-sdk/x/auth/module", - "github.com/cosmos/cosmos-sdk/x/bank/module", - }, - }, - { - name: "test two keeper import", - blankImports: []string{ - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts", - }, - discovered: []string{ - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper", - "github.com/cosmos/cosmos-sdk/x/bank/keeper", - }, - want: []string{ - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts", - "github.com/cosmos/cosmos-sdk/x/bank/keeper", - }, - }, - { - name: "test keeper imports", - blankImports: []string{ - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts", - "cosmossdk.io/x/feegrant/module", - }, - discovered: []string{ - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper", - "github.com/cosmos/cosmos-sdk/x/bank/keeper", - "cosmossdk.io/x/feegrant/types", - "cosmossdk.io/x/feegrant", - "cosmossdk.io/x/foo", - }, - want: []string{ - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts", - "github.com/cosmos/cosmos-sdk/x/bank/keeper", - "cosmossdk.io/x/feegrant/module", - "cosmossdk.io/x/foo", - }, - }, - { - name: "test three keeper import", - blankImports: []string{ - "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts", - "github.com/cosmos/ibc-go/modules/capability", - }, - discovered: []string{ - "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts", - "github.com/cosmos/ibc-go/modules/capability", - }, - want: []string{ - "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts", - "github.com/cosmos/ibc-go/modules/capability", - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := mergeImports(tt.blankImports, tt.discovered) - require.ElementsMatch(t, tt.want, got) - }) - } -} - func Test_removeKeeperPkgPath(t *testing.T) { tests := []struct { name string diff --git a/ignite/pkg/cosmosanalysis/app/testdata/app_generic.go b/ignite/pkg/cosmosanalysis/app/testdata/app_generic.go index d3b6b88597..7125b63780 100644 --- a/ignite/pkg/cosmosanalysis/app/testdata/app_generic.go +++ b/ignite/pkg/cosmosanalysis/app/testdata/app_generic.go @@ -8,7 +8,7 @@ import ( paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" abci "github.com/tendermint/tendermint/abci/types" - app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" + app "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" ) type Foo[T any] struct { diff --git a/ignite/pkg/cosmosanalysis/app/testdata/app_minimal.go b/ignite/pkg/cosmosanalysis/app/testdata/app_minimal.go index 71ab8ba218..e845e17a83 100644 --- a/ignite/pkg/cosmosanalysis/app/testdata/app_minimal.go +++ b/ignite/pkg/cosmosanalysis/app/testdata/app_minimal.go @@ -8,7 +8,7 @@ import ( paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" abci "github.com/tendermint/tendermint/abci/types" - app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" + app "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" ) type Foo struct { diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/app_config/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/app_config/go.mod new file mode 100644 index 0000000000..c740bc6ccb --- /dev/null +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/app_config/go.mod @@ -0,0 +1,30 @@ +module app + +go 1.20 + +require ( + cosmossdk.io/api v0.3.1 + cosmossdk.io/core v0.5.1 + cosmossdk.io/depinject v1.0.0-alpha.3 + cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/math v1.0.1 + github.com/bufbuild/buf v1.23.1 + github.com/cometbft/cometbft v0.37.2 + github.com/cometbft/cometbft-db v0.8.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.2 + github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/gogoproto v1.4.10 + github.com/cosmos/ibc-go/v7 v7.2.0 + github.com/golang/protobuf v1.5.3 + github.com/gorilla/mux v1.8.0 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 + github.com/spf13/cast v1.5.1 + github.com/spf13/cobra v1.7.0 + github.com/spf13/pflag v1.0.5 + github.com/stretchr/testify v1.8.4 + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 + google.golang.org/grpc v1.55.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 + google.golang.org/protobuf v1.31.0 +) diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/crescent/app.go b/ignite/pkg/cosmosanalysis/app/testdata/modules/crescent/app.go index 17455318e7..a01d492c2a 100644 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/crescent/app.go +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/crescent/app.go @@ -11,7 +11,6 @@ import ( "path/filepath" storetypes "cosmossdk.io/store/types" - "github.com/cosmos/cosmos-sdk/server" "cosmossdk.io/client/v2/autocli" "github.com/gorilla/mux" @@ -1031,13 +1030,3 @@ func (App) GetSubspace(moduleName string) paramstypes.Subspace { func (App) SimulationManager() *module.SimulationManager { return app.sm } - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - app.App.RegisterAPIRoutes(apiSvr, apiConfig) - // register swagger API in app.go so that other applications can override easily - if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { - panic(err) - } -} diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/crescent/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/crescent/go.mod new file mode 100644 index 0000000000..d0b47f88a3 --- /dev/null +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/crescent/go.mod @@ -0,0 +1,29 @@ +module github.com/crescent-network/crescent/v5 + +go 1.18 + +require ( + github.com/cosmos/cosmos-sdk v0.45.10 + github.com/cosmos/ibc-go/v3 v3.4.0 + github.com/gogo/protobuf v1.3.3 + github.com/golang/mock v1.6.0 + github.com/golang/protobuf v1.5.2 + github.com/golangci/golangci-lint v1.50.1 + github.com/gorilla/mux v1.8.0 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.13.0 + github.com/rakyll/statik v0.1.7 + github.com/regen-network/cosmos-proto v0.3.1 + github.com/spf13/cast v1.5.0 + github.com/spf13/cobra v1.6.0 + github.com/spf13/pflag v1.0.5 + github.com/stretchr/testify v1.8.0 + github.com/tendermint/tendermint v0.34.22 + github.com/tendermint/tm-db v0.6.7 + golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e + google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c + google.golang.org/grpc v1.50.1 + google.golang.org/protobuf v1.28.1 + gopkg.in/yaml.v2 v2.4.0 +) + diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/app.go b/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/app.go index 27ee658340..e9c475528d 100644 --- a/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/app.go +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/app.go @@ -8,8 +8,6 @@ import ( "os" "path/filepath" - "github.com/cosmos/cosmos-sdk/server" - "cosmossdk.io/client/v2/autocli" sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/baseapp" @@ -1096,13 +1094,3 @@ func (GaiaApp) GetSubspace(moduleName string) paramstypes.Subspace { func (GaiaApp) SimulationManager() *module.SimulationManager { return app.sm } - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - app.App.RegisterAPIRoutes(apiSvr, apiConfig) - // register swagger API in app.go so that other applications can override easily - if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { - panic(err) - } -} diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/go.mod new file mode 100644 index 0000000000..0851601f21 --- /dev/null +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/go.mod @@ -0,0 +1,28 @@ +module github.com/cosmos/gaia/v14 + +go 1.20 + +require ( + cosmossdk.io/errors v1.0.0 + cosmossdk.io/math v1.2.0 + github.com/cosmos/cosmos-sdk v0.45.16 + github.com/cosmos/go-bip39 v1.0.0 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v4 v4.1.1 + github.com/cosmos/ibc-go/v4 v4.4.2 + github.com/cosmos/interchain-security/v2 v2.0.0 + github.com/gogo/protobuf v1.3.3 + github.com/golang/protobuf v1.5.3 + github.com/google/gofuzz v1.2.0 + github.com/gorilla/mux v1.8.1 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/ory/dockertest/v3 v3.10.0 + github.com/rakyll/statik v0.1.7 + github.com/spf13/cast v1.5.1 + github.com/spf13/cobra v1.8.0 + github.com/spf13/viper v1.17.0 + github.com/stretchr/testify v1.8.4 + github.com/tendermint/tendermint v0.34.27 + github.com/tendermint/tm-db v0.6.7 + google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb + google.golang.org/grpc v1.58.2 +) diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/go.mod new file mode 100644 index 0000000000..c3c0312603 --- /dev/null +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/juno/go.mod @@ -0,0 +1,33 @@ +module github.com/CosmosContracts/juno/v18 + +go 1.21 + +require ( + cosmossdk.io/api v0.3.1 + cosmossdk.io/errors v1.0.0 + cosmossdk.io/log v1.2.1 + cosmossdk.io/math v1.1.2 + cosmossdk.io/tools/rosetta v0.2.1 + github.com/CosmWasm/wasmd v0.45.0 + github.com/CosmWasm/wasmvm v1.5.0 + github.com/cometbft/cometbft v0.37.2 + github.com/cometbft/cometbft-db v0.8.0 + github.com/cosmos/cosmos-sdk v0.47.5 + github.com/cosmos/gogoproto v1.4.10 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.1 + github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 + github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79 + github.com/cosmos/ibc-go/v7 v7.3.1 + github.com/golang/protobuf v1.5.3 + github.com/gorilla/mux v1.8.0 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/prometheus/client_golang v1.16.0 + github.com/skip-mev/pob v1.0.4 + github.com/spf13/cast v1.5.1 + github.com/spf13/cobra v1.7.0 + github.com/spf13/viper v1.16.0 + github.com/stretchr/testify v1.8.4 + google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 + google.golang.org/grpc v1.58.3 + gopkg.in/yaml.v2 v2.4.0 +) diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/single_app/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/single_app/go.mod new file mode 100644 index 0000000000..5db6c247a4 --- /dev/null +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/single_app/go.mod @@ -0,0 +1,32 @@ +module app + +go 1.20 + +require ( + cosmossdk.io/api v0.3.1 + cosmossdk.io/core v0.5.1 + cosmossdk.io/depinject v1.0.0-alpha.3 + cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/math v1.0.1 + github.com/bufbuild/buf v1.23.1 + github.com/cometbft/cometbft v0.37.2 + github.com/cometbft/cometbft-db v0.8.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.2 + github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/gogoproto v1.4.10 + github.com/cosmos/ibc-go/v7 v7.2.0 + github.com/golang/protobuf v1.5.3 + github.com/gorilla/mux v1.8.0 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 + github.com/spf13/cast v1.5.1 + github.com/spf13/cobra v1.7.0 + github.com/spf13/pflag v1.0.5 + github.com/stretchr/testify v1.8.4 + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 + google.golang.org/grpc v1.55.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 + google.golang.org/protobuf v1.31.0 +) + + diff --git a/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/go.mod b/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/go.mod new file mode 100644 index 0000000000..39414c01ea --- /dev/null +++ b/ignite/pkg/cosmosanalysis/app/testdata/modules/spn/go.mod @@ -0,0 +1,343 @@ +module github.com/tendermint/spn + +go 1.19 + +require ( + cosmossdk.io/api v0.3.1 + cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/math v1.0.1 + github.com/aws/smithy-go v1.8.0 + github.com/bufbuild/buf v1.22.0 + github.com/cometbft/cometbft v0.37.2 + github.com/cometbft/cometbft-db v0.8.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.2 + github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/gogoproto v1.4.10 + github.com/cosmos/ibc-go/v7 v7.2.0 + github.com/gogo/protobuf v1.3.2 + github.com/golang/protobuf v1.5.3 + github.com/golangci/golangci-lint v1.50.1 + github.com/gorilla/mux v1.8.0 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 + github.com/ignite/modules v0.0.2 + github.com/pkg/errors v0.9.1 + github.com/spf13/cast v1.5.1 + github.com/spf13/cobra v1.7.0 + github.com/spf13/pflag v1.0.5 + github.com/stretchr/testify v1.8.4 + github.com/tendermint/fundraising v0.4.1 + golang.org/x/tools v0.10.0 + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 + google.golang.org/grpc v1.55.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 + google.golang.org/protobuf v1.31.0 + gopkg.in/yaml.v2 v2.4.0 + mvdan.cc/gofumpt v0.5.0 +) + +replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 + +require ( + 4d63.com/gochecknoglobals v0.1.0 // indirect + cloud.google.com/go v0.110.0 // indirect + cloud.google.com/go/compute v1.19.1 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v1.0.0 // indirect + cloud.google.com/go/storage v1.30.1 // indirect + cosmossdk.io/core v0.5.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.3 // indirect + cosmossdk.io/log v1.1.0 // indirect + cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff // indirect + cosmossdk.io/tools/rosetta v0.2.1 // indirect + filippo.io/edwards25519 v1.0.0 // indirect + github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect + github.com/99designs/keyring v1.2.1 // indirect + github.com/Abirdcfly/dupword v0.0.7 // indirect + github.com/Antonboom/errname v0.1.7 // indirect + github.com/Antonboom/nilnil v0.1.1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect + github.com/BurntSushi/toml v1.2.1 // indirect + github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/OpenPeeDeeP/depguard v1.1.1 // indirect + github.com/alexkohler/prealloc v1.0.0 // indirect + github.com/alingse/asasalint v0.0.11 // indirect + github.com/armon/go-metrics v0.4.1 // indirect + github.com/ashanbrown/forbidigo v1.3.0 // indirect + github.com/ashanbrown/makezero v1.1.1 // indirect + github.com/aws/aws-sdk-go v1.44.244 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect + github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bkielbasa/cyclop v1.2.0 // indirect + github.com/blizzy78/varnamelen v0.8.0 // indirect + github.com/bombsimon/wsl/v3 v3.3.0 // indirect + github.com/breml/bidichk v0.2.3 // indirect + github.com/breml/errchkjson v0.3.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/bufbuild/connect-go v1.8.0 // indirect + github.com/bufbuild/connect-opentelemetry-go v0.3.0 // indirect + github.com/bufbuild/protocompile v0.5.1 // indirect + github.com/butuzov/ireturn v0.1.1 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/charithe/durationcheck v0.0.9 // indirect + github.com/chavacava/garif v0.0.0-20220630083739-93517212f375 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/chzyer/readline v1.5.1 // indirect + github.com/cockroachdb/apd/v2 v2.0.2 // indirect + github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect + github.com/confio/ics23/go v0.9.0 // indirect + github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/iavl v0.20.0 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect + github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/creachadair/taskgroup v0.4.2 // indirect + github.com/curioswitch/go-reassign v0.2.0 // indirect + github.com/daixiang0/gci v0.8.1 // indirect + github.com/danieljoos/wincred v1.1.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/denis-tingaikin/go-header v0.4.3 // indirect + github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect + github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/docker/cli v24.0.2+incompatible // indirect + github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/docker/docker v24.0.2+incompatible // indirect + github.com/docker/docker-credential-helpers v0.7.0 // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/esimonov/ifshort v1.0.4 // indirect + github.com/ettle/strcase v0.1.1 // indirect + github.com/fatih/color v1.13.0 // indirect + github.com/fatih/structtag v1.2.0 // indirect + github.com/felixge/fgprof v0.9.3 // indirect + github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/firefart/nonamedreturns v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fzipp/gocyclo v0.6.0 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/go-chi/chi/v5 v5.0.8 // indirect + github.com/go-critic/go-critic v0.6.5 // indirect + github.com/go-kit/kit v0.12.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-toolsmith/astcast v1.0.0 // indirect + github.com/go-toolsmith/astcopy v1.0.2 // indirect + github.com/go-toolsmith/astequal v1.0.3 // indirect + github.com/go-toolsmith/astfmt v1.0.0 // indirect + github.com/go-toolsmith/astp v1.0.0 // indirect + github.com/go-toolsmith/strparse v1.0.0 // indirect + github.com/go-toolsmith/typep v1.0.2 // indirect + github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect + github.com/gobwas/glob v0.2.3 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gofrs/flock v0.8.1 // indirect + github.com/gofrs/uuid/v5 v5.0.0 // indirect + github.com/gogo/googleapis v1.4.1 // indirect + github.com/golang/glog v1.1.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect + github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect + github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect + github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect + github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect + github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect + github.com/golangci/misspell v0.3.5 // indirect + github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect + github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect + github.com/google/btree v1.1.2 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-containerregistry v0.15.2 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect + github.com/google/s2a-go v0.1.3 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/googleapis/gax-go/v2 v2.8.0 // indirect + github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 // indirect + github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/gostaticanalysis/analysisutil v0.7.1 // indirect + github.com/gostaticanalysis/comment v1.4.2 // indirect + github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect + github.com/gostaticanalysis/nilerr v0.1.1 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/gtank/merlin v0.1.1 // indirect + github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/hexops/gotextdiff v1.0.3 // indirect + github.com/huandu/skiplist v1.2.0 // indirect + github.com/improbable-eng/grpc-web v0.15.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect + github.com/jgautheron/goconst v1.5.1 // indirect + github.com/jingyugao/rowserrcheck v1.1.1 // indirect + github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/jmhodges/levigo v1.0.0 // indirect + github.com/julz/importas v0.1.0 // indirect + github.com/kisielk/errcheck v1.6.2 // indirect + github.com/kisielk/gotool v1.0.0 // indirect + github.com/kkHAIKE/contextcheck v1.1.3 // indirect + github.com/klauspost/compress v1.16.6 // indirect + github.com/klauspost/pgzip v1.2.6 // indirect + github.com/kulti/thelper v0.6.3 // indirect + github.com/kunwardeep/paralleltest v1.0.6 // indirect + github.com/kyoh86/exportloopref v0.1.8 // indirect + github.com/ldez/gomoddirectives v0.2.3 // indirect + github.com/ldez/tagliatelle v0.3.1 // indirect + github.com/leonklingele/grouper v1.1.0 // indirect + github.com/lib/pq v1.10.7 // indirect + github.com/libp2p/go-buffer-pool v0.1.0 // indirect + github.com/linxGnu/grocksdb v1.7.16 // indirect + github.com/lufeee/execinquery v1.2.1 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/manifoldco/promptui v0.9.0 // indirect + github.com/maratori/testableexamples v1.0.0 // indirect + github.com/maratori/testpackage v1.1.0 // indirect + github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/mbilski/exhaustivestruct v1.2.0 // indirect + github.com/mgechev/revive v1.2.4 // indirect + github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect + github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/term v0.5.0 // indirect + github.com/moricho/tparallel v0.2.1 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/mtibben/percent v0.2.1 // indirect + github.com/nakabonne/nestif v0.3.1 // indirect + github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect + github.com/nishanths/exhaustive v0.8.3 // indirect + github.com/nishanths/predeclared v0.2.2 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0-rc3 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect + github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/pkg/profile v1.7.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/polyfloyd/go-errorlint v1.0.5 // indirect + github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect + github.com/quasilyte/go-ruleguard v0.3.18 // indirect + github.com/quasilyte/gogrep v0.0.0-20220828223005-86e4605de09f // indirect + github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect + github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect + github.com/rakyll/statik v0.1.7 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rs/cors v1.9.0 // indirect + github.com/rs/zerolog v1.29.1 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryancurrah/gomodguard v1.2.4 // indirect + github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect + github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect + github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sashamelentyev/interfacebloat v1.1.0 // indirect + github.com/sashamelentyev/usestdlibvars v1.20.0 // indirect + github.com/securego/gosec/v2 v2.13.1 // indirect + github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect + github.com/sirupsen/logrus v1.9.3 // indirect + github.com/sivchari/containedctx v1.0.2 // indirect + github.com/sivchari/nosnakecase v1.7.0 // indirect + github.com/sivchari/tenv v1.7.0 // indirect + github.com/sonatard/noctx v0.0.1 // indirect + github.com/sourcegraph/go-diff v0.6.1 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/viper v1.16.0 // indirect + github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect + github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect + github.com/stretchr/objx v0.5.0 // indirect + github.com/subosito/gotenv v1.4.2 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect + github.com/tdakkota/asciicheck v0.1.1 // indirect + github.com/tendermint/go-amino v0.16.0 // indirect + github.com/tetafro/godot v1.4.11 // indirect + github.com/tetratelabs/wazero v1.2.1 // indirect + github.com/tidwall/btree v1.6.0 // indirect + github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144 // indirect + github.com/timonwong/loggercheck v0.9.3 // indirect + github.com/tomarrell/wrapcheck/v2 v2.7.0 // indirect + github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect + github.com/ultraware/funlen v0.0.3 // indirect + github.com/ultraware/whitespace v0.0.5 // indirect + github.com/uudashr/gocognit v1.0.6 // indirect + github.com/vbatts/tar-split v0.11.3 // indirect + github.com/yagipy/maintidx v1.0.0 // indirect + github.com/yeya24/promlinter v0.2.0 // indirect + github.com/zondax/hid v0.9.1 // indirect + github.com/zondax/ledger-go v0.14.1 // indirect + gitlab.com/bosi/decorder v0.2.3 // indirect + go.etcd.io/bbolt v1.3.7 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/otel v1.16.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.opentelemetry.io/otel/sdk v1.16.0 // indirect + go.opentelemetry.io/otel/trace v1.16.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.24.0 // indirect + golang.org/x/crypto v0.10.0 // indirect + golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect + golang.org/x/exp/typeparams v0.0.0-20220827204233-334a2380cb91 // indirect + golang.org/x/mod v0.11.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/term v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + google.golang.org/api v0.122.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + honnef.co/go/tools v0.3.3 // indirect + mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect + mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect + mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 // indirect + nhooyr.io/websocket v1.8.6 // indirect + pgregory.net/rapid v0.5.5 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) diff --git a/ignite/pkg/cosmosanalysis/app/testdata/two_app.go b/ignite/pkg/cosmosanalysis/app/testdata/two_app.go index e7697ccf54..e843f163dd 100644 --- a/ignite/pkg/cosmosanalysis/app/testdata/two_app.go +++ b/ignite/pkg/cosmosanalysis/app/testdata/two_app.go @@ -8,7 +8,7 @@ import ( paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" abci "github.com/tendermint/tendermint/abci/types" - app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" + app "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" ) type Foo struct { diff --git a/ignite/pkg/cosmosanalysis/cosmosanalysis.go b/ignite/pkg/cosmosanalysis/cosmosanalysis.go index ae72b4541a..8a07fdc909 100644 --- a/ignite/pkg/cosmosanalysis/cosmosanalysis.go +++ b/ignite/pkg/cosmosanalysis/cosmosanalysis.go @@ -13,8 +13,8 @@ import ( "github.com/pkg/errors" "golang.org/x/mod/modfile" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/pkg/gomodule" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" ) const ( diff --git a/ignite/pkg/cosmosanalysis/cosmosanalysis_test.go b/ignite/pkg/cosmosanalysis/cosmosanalysis_test.go index 713a54a156..de70ca972f 100644 --- a/ignite/pkg/cosmosanalysis/cosmosanalysis_test.go +++ b/ignite/pkg/cosmosanalysis/cosmosanalysis_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis" ) var ( diff --git a/ignite/pkg/cosmosanalysis/module/module.go b/ignite/pkg/cosmosanalysis/module/module.go index ba6e98f1b1..7a662e7f24 100644 --- a/ignite/pkg/cosmosanalysis/module/module.go +++ b/ignite/pkg/cosmosanalysis/module/module.go @@ -10,10 +10,11 @@ import ( "golang.org/x/mod/semver" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app" - "github.com/ignite/cli/ignite/pkg/gomodule" - "github.com/ignite/cli/ignite/pkg/protoanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/app" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) // Msgs is a module import path-sdk msgs pair. @@ -83,6 +84,12 @@ type moduleDiscoverer struct { registeredModules []string } +// IsCosmosSDKModulePkg check if a Go import path is a Cosmos SDK package module. +// These type of package have the "cosmossdk.io/x" prefix. +func IsCosmosSDKModulePkg(path string) bool { + return strings.Contains(path, "cosmossdk.io/x/") +} + // Discover discovers and returns modules and their types that are registered in the app // chainRoot is the root path of the chain // sourcePath is the root path of the go module which the proto dir is from @@ -92,7 +99,12 @@ type moduleDiscoverer struct { // 1. Getting all the registered Go modules from the app. // 2. Parsing the proto files to find services and messages. // 3. Check if the proto services are implemented in any of the registered modules. -func Discover(ctx context.Context, chainRoot, sourcePath, protoDir string) ([]Module, error) { +func Discover(ctx context.Context, chainRoot, sourcePath string, options ...DiscoverOption) ([]Module, error) { + var o discoverOptions + for _, apply := range options { + apply(&o) + } + // find out base Go import path of the blockchain. gm, err := gomodule.ParseAt(sourcePath) if err != nil { @@ -124,8 +136,18 @@ func Discover(ctx context.Context, chainRoot, sourcePath, protoDir string) ([]Mo return []Module{}, nil } + // Switch the proto path for "cosmossdk.io" module packages to the official Cosmos + // SDK package because the module packages doesn't contain the proto files. These + // files are only available from the Cosmos SDK package. + var protoPath string + if o.sdkDir != "" && IsCosmosSDKModulePkg(sourcePath) { + protoPath = switchCosmosSDKPackagePath(sourcePath, o.sdkDir) + } else { + protoPath = filepath.Join(sourcePath, o.protoDir) + } + md := &moduleDiscoverer{ - protoPath: filepath.Join(sourcePath, protoDir), + protoPath: protoPath, sourcePath: sourcePath, basegopath: basegopath, registeredModules: appModules, @@ -235,7 +257,6 @@ func (d *moduleDiscoverer) discover(pkg protoanalysis.Package) (Module, error) { Pkg: pkg, } - // fill sdk Msgs. for _, msg := range msgs { pkgmsg, err := pkg.MessageByName(msg) if err != nil { @@ -268,13 +289,8 @@ func (d *moduleDiscoverer) discover(pkg protoanalysis.Package) (Module, error) { // do not use if used as a request/return type of RPC. for _, s := range pkg.Services { - for i, q := range s.RPCFuncs { + for _, q := range s.RPCFuncs { if q.RequestType == protomsg.Name || q.ReturnsType == protomsg.Name { - // Check if the service response message is using pagination and - // update the RPC function. This is done here to avoid extra loops - // just to update the pagination property. - s.RPCFuncs[i].Paginated = hasPagination(protomsg) - return false } } @@ -285,6 +301,17 @@ func (d *moduleDiscoverer) discover(pkg protoanalysis.Package) (Module, error) { // fill types. for _, protomsg := range pkg.Messages { + // Update pagination for RPC functions when a service response uses pagination + if hasPagination(protomsg) { + for _, s := range pkg.Services { + for i, q := range s.RPCFuncs { + if q.RequestType == protomsg.Name || q.ReturnsType == protomsg.Name { + s.RPCFuncs[i].Paginated = true + } + } + } + } + if !isType(protomsg) { continue } @@ -420,3 +447,11 @@ func hasPagination(msg protoanalysis.Message) bool { return false } + +func switchCosmosSDKPackagePath(srcPath, sdkDir string) string { + modName := xstrings.StringBetween(srcPath, "/x/", "@") + if modName == "" { + return srcPath + } + return filepath.Join(sdkDir, "proto", "cosmos", modName) +} diff --git a/ignite/pkg/cosmosanalysis/module/module_test.go b/ignite/pkg/cosmosanalysis/module/module_test.go index 0ba79a2f15..0f1efc9f03 100644 --- a/ignite/pkg/cosmosanalysis/module/module_test.go +++ b/ignite/pkg/cosmosanalysis/module/module_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/module" - "github.com/ignite/cli/ignite/pkg/protoanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis" ) func newModule(relChainPath, goImportPath string) module.Module { @@ -156,7 +156,7 @@ func TestDiscover(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - modules, err := module.Discover(ctx, sourcePath, tt.sourcePath, tt.protoDir) + modules, err := module.Discover(ctx, sourcePath, tt.sourcePath, module.WithProtoDir(tt.protoDir)) require.NoError(t, err) require.Equal(t, tt.want, modules) @@ -193,7 +193,7 @@ func TestDiscoverWithAppV2(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - modules, err := module.Discover(ctx, sourcePath, sourcePath, tt.protoDir) + modules, err := module.Discover(ctx, sourcePath, sourcePath, module.WithProtoDir(tt.protoDir)) require.NoError(t, err) require.Equal(t, tt.want, modules) diff --git a/ignite/pkg/cosmosanalysis/module/options.go b/ignite/pkg/cosmosanalysis/module/options.go new file mode 100644 index 0000000000..20820785f8 --- /dev/null +++ b/ignite/pkg/cosmosanalysis/module/options.go @@ -0,0 +1,22 @@ +package module + +// DiscoverOption configures calls to Discovery function. +type DiscoverOption func(*discoverOptions) + +type discoverOptions struct { + protoDir, sdkDir string +} + +// WithProtoDir sets the relative proto directory path. +func WithProtoDir(path string) DiscoverOption { + return func(o *discoverOptions) { + o.protoDir = path + } +} + +// WithSDKDir sets the absolute directory path to the Cosmos SDK Go package. +func WithSDKDir(path string) DiscoverOption { + return func(o *discoverOptions) { + o.sdkDir = path + } +} diff --git a/ignite/pkg/cosmosanalysis/module/testdata/earth/app/app.go b/ignite/pkg/cosmosanalysis/module/testdata/earth/app/app.go index 57feb0babc..c999d6a42d 100644 --- a/ignite/pkg/cosmosanalysis/module/testdata/earth/app/app.go +++ b/ignite/pkg/cosmosanalysis/module/testdata/earth/app/app.go @@ -15,7 +15,7 @@ import ( marskeeper "github.com/tendermint/planet/x/mars/keeper" abci "github.com/tendermint/tendermint/abci/types" - app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" + app "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" ) type Foo struct { diff --git a/ignite/pkg/cosmosanalysis/module/testdata/planet/app/app.go b/ignite/pkg/cosmosanalysis/module/testdata/planet/app/app.go index b2308b8699..f94ed79581 100644 --- a/ignite/pkg/cosmosanalysis/module/testdata/planet/app/app.go +++ b/ignite/pkg/cosmosanalysis/module/testdata/planet/app/app.go @@ -15,7 +15,7 @@ import ( marskeeper "github.com/tendermint/planet/x/mars/keeper" abci "github.com/tendermint/tendermint/abci/types" - app "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" + app "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/app/testdata/modules/registration_not_in_app_go" ) type Foo struct { diff --git a/ignite/pkg/cosmosbuf/buf.go b/ignite/pkg/cosmosbuf/buf.go index b1b5a2c7e4..709a7bd2ca 100644 --- a/ignite/pkg/cosmosbuf/buf.go +++ b/ignite/pkg/cosmosbuf/buf.go @@ -10,11 +10,11 @@ import ( "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/pkg/cmdrunner/exec" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/pkg/protoanalysis" - "github.com/ignite/cli/ignite/pkg/xexec" - "github.com/ignite/cli/ignite/pkg/xos" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis" + "github.com/ignite/cli/v28/ignite/pkg/xexec" + "github.com/ignite/cli/v28/ignite/pkg/xos" ) type ( diff --git a/ignite/pkg/cosmosclient/bank.go b/ignite/pkg/cosmosclient/bank.go index 197d5c4949..ba67bcee9b 100644 --- a/ignite/pkg/cosmosclient/bank.go +++ b/ignite/pkg/cosmosclient/bank.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" ) func (c Client) BankBalances(ctx context.Context, address string, pagination *query.PageRequest) (sdk.Coins, error) { diff --git a/ignite/pkg/cosmosclient/cosmosclient.go b/ignite/pkg/cosmosclient/cosmosclient.go index fcd48b0124..b01bc6dfd0 100644 --- a/ignite/pkg/cosmosclient/cosmosclient.go +++ b/ignite/pkg/cosmosclient/cosmosclient.go @@ -36,8 +36,8 @@ import ( prototypes "github.com/cosmos/gogoproto/types" "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/cosmosfaucet" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" ) var ( diff --git a/ignite/pkg/cosmosclient/cosmosclient_test.go b/ignite/pkg/cosmosclient/cosmosclient_test.go index 48cebb9c1d..38148e8af4 100644 --- a/ignite/pkg/cosmosclient/cosmosclient_test.go +++ b/ignite/pkg/cosmosclient/cosmosclient_test.go @@ -23,11 +23,11 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmosclient/mocks" - "github.com/ignite/cli/ignite/pkg/cosmosclient/testutil" - "github.com/ignite/cli/ignite/pkg/cosmosfaucet" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient/mocks" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient/testutil" + "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" ) const ( diff --git a/ignite/pkg/cosmosclient/mocks/faucet_client.go b/ignite/pkg/cosmosclient/mocks/faucet_client.go index e8a52676f2..21b15879ed 100644 --- a/ignite/pkg/cosmosclient/mocks/faucet_client.go +++ b/ignite/pkg/cosmosclient/mocks/faucet_client.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - cosmosfaucet "github.com/ignite/cli/ignite/pkg/cosmosfaucet" + cosmosfaucet "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" mock "github.com/stretchr/testify/mock" ) diff --git a/ignite/pkg/cosmosclient/testutil/mocks.go b/ignite/pkg/cosmosclient/testutil/mocks.go index dbf1ccef52..33eda9fbe0 100644 --- a/ignite/pkg/cosmosclient/testutil/mocks.go +++ b/ignite/pkg/cosmosclient/testutil/mocks.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/mock" - "github.com/ignite/cli/ignite/pkg/cosmosclient/mocks" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient/mocks" ) //go:generate mockery --srcpkg github.com/cometbft/cometbft/rpc/client --name Client --structname RPCClient --filename rpc_client.go --output ../mocks --with-expecter diff --git a/ignite/pkg/cosmosclient/txservice_test.go b/ignite/pkg/cosmosclient/txservice_test.go index c5f3db5fb4..4b600b3c68 100644 --- a/ignite/pkg/cosmosclient/txservice_test.go +++ b/ignite/pkg/cosmosclient/txservice_test.go @@ -15,8 +15,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" ) func TestTxServiceBroadcast(t *testing.T) { diff --git a/ignite/pkg/cosmoserror/error_test.go b/ignite/pkg/cosmoserror/error_test.go index b7f4a3d68b..63d27f814c 100644 --- a/ignite/pkg/cosmoserror/error_test.go +++ b/ignite/pkg/cosmoserror/error_test.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/ignite/cli/ignite/pkg/cosmoserror" + "github.com/ignite/cli/v28/ignite/pkg/cosmoserror" ) func TestUnwrap(t *testing.T) { diff --git a/ignite/pkg/cosmosfaucet/cosmosfaucet.go b/ignite/pkg/cosmosfaucet/cosmosfaucet.go index b8a9ea5ed0..7ecaf4499c 100644 --- a/ignite/pkg/cosmosfaucet/cosmosfaucet.go +++ b/ignite/pkg/cosmosfaucet/cosmosfaucet.go @@ -9,8 +9,8 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner" - "github.com/ignite/cli/ignite/pkg/cosmosver" + chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" ) const ( diff --git a/ignite/pkg/cosmosfaucet/http.go b/ignite/pkg/cosmosfaucet/http.go index 3b87f4180f..5664c3e5ce 100644 --- a/ignite/pkg/cosmosfaucet/http.go +++ b/ignite/pkg/cosmosfaucet/http.go @@ -6,7 +6,7 @@ import ( "github.com/gorilla/mux" "github.com/rs/cors" - "github.com/ignite/cli/ignite/pkg/openapiconsole" + "github.com/ignite/cli/v28/ignite/pkg/openapiconsole" ) // ServeHTTP implements http.Handler to expose the functionality of Faucet.Transfer() via HTTP. diff --git a/ignite/pkg/cosmosfaucet/http_faucet.go b/ignite/pkg/cosmosfaucet/http_faucet.go index 5eff67c0f9..2196d6488f 100644 --- a/ignite/pkg/cosmosfaucet/http_faucet.go +++ b/ignite/pkg/cosmosfaucet/http_faucet.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ignite/cli/ignite/pkg/xhttp" + "github.com/ignite/cli/v28/ignite/pkg/xhttp" ) type TransferRequest struct { diff --git a/ignite/pkg/cosmosfaucet/http_test.go b/ignite/pkg/cosmosfaucet/http_test.go index da57c7e67b..848a4010a4 100644 --- a/ignite/pkg/cosmosfaucet/http_test.go +++ b/ignite/pkg/cosmosfaucet/http_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosfaucet" + "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" ) func TestServeHTTPCORS(t *testing.T) { diff --git a/ignite/pkg/cosmosfaucet/openapi/openapi.yml.tmpl b/ignite/pkg/cosmosfaucet/openapi/openapi.yml.tmpl index e24875af0a..b69f634492 100644 --- a/ignite/pkg/cosmosfaucet/openapi/openapi.yml.tmpl +++ b/ignite/pkg/cosmosfaucet/openapi/openapi.yml.tmpl @@ -58,4 +58,4 @@ definitions: externalDocs: description: "Find out more about Ignite CLI" - url: "https://github.com/ignite/cli/tree/develop/docs" + url: "https://github.com/ignite/cli/tree/main/docs" diff --git a/ignite/pkg/cosmosfaucet/transfer.go b/ignite/pkg/cosmosfaucet/transfer.go index 10365bee5b..b6da37c7e4 100644 --- a/ignite/pkg/cosmosfaucet/transfer.go +++ b/ignite/pkg/cosmosfaucet/transfer.go @@ -10,9 +10,9 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ignite/cli/ignite/pkg/chaincmd" - chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner" - "github.com/ignite/cli/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" ) // transferMutex is a mutex used for keeping transfer requests in a queue so checking account balance and sending tokens is atomic. diff --git a/ignite/pkg/cosmosgen/cosmosgen.go b/ignite/pkg/cosmosgen/cosmosgen.go index 507a90c369..8a3dd8412e 100644 --- a/ignite/pkg/cosmosgen/cosmosgen.go +++ b/ignite/pkg/cosmosgen/cosmosgen.go @@ -9,10 +9,10 @@ import ( "github.com/iancoleman/strcase" gomodule "golang.org/x/mod/module" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/module" - "github.com/ignite/cli/ignite/pkg/cosmosbuf" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/cosmosbuf" + "github.com/ignite/cli/v28/ignite/pkg/events" ) // generateOptions used to configure code generation. @@ -123,6 +123,7 @@ type generator struct { gomodPath string opts *generateOptions sdkImport string + sdkDir string deps []gomodule.Version appModules []module.Module appIncludes protoIncludes diff --git a/ignite/pkg/cosmosgen/cosmosgen_test.go b/ignite/pkg/cosmosgen/cosmosgen_test.go index f986d40689..b76a2a4065 100644 --- a/ignite/pkg/cosmosgen/cosmosgen_test.go +++ b/ignite/pkg/cosmosgen/cosmosgen_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/module" - "github.com/ignite/cli/ignite/pkg/protoanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis" ) func TestTypescriptModulePath(t *testing.T) { diff --git a/ignite/pkg/cosmosgen/generate.go b/ignite/pkg/cosmosgen/generate.go index 840b100a8d..8fb7cbd97c 100644 --- a/ignite/pkg/cosmosgen/generate.go +++ b/ignite/pkg/cosmosgen/generate.go @@ -13,18 +13,18 @@ import ( "github.com/pkg/errors" "gopkg.in/yaml.v2" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/module" - "github.com/ignite/cli/ignite/pkg/cosmosbuf" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/pkg/gomodule" - "github.com/ignite/cli/ignite/pkg/xfilepath" - "github.com/ignite/cli/ignite/pkg/xos" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/cosmosbuf" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" + "github.com/ignite/cli/v28/ignite/pkg/xfilepath" + "github.com/ignite/cli/v28/ignite/pkg/xos" ) const ( @@ -34,7 +34,8 @@ const ( ) var ( - ErrBufConfig = errors.New("invalid Buf config") + ErrBufConfig = errors.New("invalid Buf config") + ErrMissingSDKDep = errors.New("cosmos SDK dependency not found") protocGlobalInclude = xfilepath.List( xfilepath.JoinFromHome(xfilepath.Path("local/include")), @@ -112,8 +113,15 @@ func (g *generator) setup(ctx context.Context) (err error) { return err } - // Discover any custom modules defined by the user's app - g.appModules, err = g.discoverModules(ctx, g.appPath, g.protoDir) + // Discover any custom modules defined by the user's app. + // Use the configured proto directory to locate app's proto files. + g.appModules, err = module.Discover( + ctx, + g.appPath, + g.appPath, + module.WithProtoDir(g.protoDir), + module.WithSDKDir(g.sdkDir), + ) if err != nil { return err } @@ -123,6 +131,19 @@ func (g *generator) setup(ctx context.Context) (err error) { return err } + dep, found := filterCosmosSDKModule(g.deps) + if !found { + return ErrMissingSDKDep + } + + // Find the full path to the Cosmos SDK Go package. + // The path is required to be able to discover proto packages for the + // set of "cosmossdk.io" packages that doesn't contain the proto files. + g.sdkDir, err = gomodule.LocatePath(ctx, g.cacheStorage, g.appPath, dep) + if err != nil { + return err + } + // Go through the Go dependencies of the user's app within go.mod, some of them // might be hosting Cosmos SDK modules that could be in use by user's blockchain. // @@ -153,8 +174,10 @@ func (g *generator) setup(ctx context.Context) (err error) { return err } - // Discover any modules defined by the package - modules, err := g.discoverModules(ctx, path, "") + // Discover any modules defined by the package. + // Use an empty string for proto directory because it will be + // discovered automatically within the dependency package path. + modules, err := module.Discover(ctx, g.appPath, path, module.WithSDKDir(g.sdkDir)) if err != nil { return err } @@ -243,14 +266,21 @@ func (g *generator) resolveIncludes(ctx context.Context, path string) (protoIncl includes := protoIncludes{Paths: paths} - // Check that the app/package proto directory exists - protoPath := filepath.Join(path, g.protoDir) - fi, err := os.Stat(protoPath) - if err != nil && !os.IsNotExist(err) { - return protoIncludes{}, false, err - } else if !fi.IsDir() { - // Just return the global includes when a proto directory doesn't exist - return includes, true, nil + // The "cosmossdk.io" module packages must use SDK's proto path which is + // where all proto files for there type of Go package are. + var protoPath string + if module.IsCosmosSDKModulePkg(path) { + protoPath = filepath.Join(g.sdkDir, "proto") + } else { + // Check that the app/package proto directory exists + protoPath = filepath.Join(path, g.protoDir) + fi, err := os.Stat(protoPath) + if err != nil && !os.IsNotExist(err) { + return protoIncludes{}, false, err + } else if !fi.IsDir() { + // Just return the global includes when a proto directory doesn't exist + return includes, true, nil + } } // Add app's proto path to the list of proto paths @@ -285,24 +315,6 @@ func (g *generator) resolveIncludes(ctx context.Context, path string) (protoIncl return includes, true, nil } -func (g *generator) discoverModules(ctx context.Context, path, protoDir string) ([]module.Module, error) { - var filteredModules []module.Module - modules, err := module.Discover(ctx, g.appPath, path, protoDir) - if err != nil { - return nil, err - } - - protoPath := filepath.Join(path, g.protoDir) - for _, m := range modules { - if !strings.HasPrefix(m.Pkg.Path, protoPath) { - continue - } - filteredModules = append(filteredModules, m) - } - - return filteredModules, nil -} - func (g generator) updateBufModule(ctx context.Context) error { for pkgPath, includes := range g.thirdModuleIncludes { // Skip third party dependencies without proto files @@ -472,3 +484,12 @@ func (g generator) vendorProtoPackage(pkgName, protoPath string) (err error) { return nil } + +func filterCosmosSDKModule(versions []gomodule.Version) (gomodule.Version, bool) { + for _, v := range versions { + if strings.HasPrefix(v.Path, cosmosver.CosmosModulePath) { + return v, true + } + } + return gomodule.Version{}, false +} diff --git a/ignite/pkg/cosmosgen/generate_composables.go b/ignite/pkg/cosmosgen/generate_composables.go index a2badb70d6..237df816be 100644 --- a/ignite/pkg/cosmosgen/generate_composables.go +++ b/ignite/pkg/cosmosgen/generate_composables.go @@ -11,8 +11,8 @@ import ( "github.com/imdario/mergo" "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/module" - "github.com/ignite/cli/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" ) type composablesGenerator struct { diff --git a/ignite/pkg/cosmosgen/generate_openapi.go b/ignite/pkg/cosmosgen/generate_openapi.go index 0100775b39..27a2042e28 100644 --- a/ignite/pkg/cosmosgen/generate_openapi.go +++ b/ignite/pkg/cosmosgen/generate_openapi.go @@ -10,12 +10,12 @@ import ( "github.com/iancoleman/strcase" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/module" - "github.com/ignite/cli/ignite/pkg/dirchange" - "github.com/ignite/cli/ignite/pkg/nodetime" - swaggercombine "github.com/ignite/cli/ignite/pkg/nodetime/programs/swagger-combine" - "github.com/ignite/cli/ignite/pkg/xos" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/dirchange" + "github.com/ignite/cli/v28/ignite/pkg/nodetime" + swaggercombine "github.com/ignite/cli/v28/ignite/pkg/nodetime/programs/swagger-combine" + "github.com/ignite/cli/v28/ignite/pkg/xos" ) const ( diff --git a/ignite/pkg/cosmosgen/generate_typescript.go b/ignite/pkg/cosmosgen/generate_typescript.go index 328eb69b51..1fbad56f41 100644 --- a/ignite/pkg/cosmosgen/generate_typescript.go +++ b/ignite/pkg/cosmosgen/generate_typescript.go @@ -9,13 +9,13 @@ import ( "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/module" - "github.com/ignite/cli/ignite/pkg/dirchange" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/nodetime/programs/sta" - tsproto "github.com/ignite/cli/ignite/pkg/nodetime/programs/ts-proto" - "github.com/ignite/cli/ignite/pkg/protoc" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/dirchange" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/nodetime/programs/sta" + tsproto "github.com/ignite/cli/v28/ignite/pkg/nodetime/programs/ts-proto" + "github.com/ignite/cli/v28/ignite/pkg/protoc" ) var ( @@ -196,7 +196,14 @@ func (g *tsGenerator) generateModuleTemplate( return err } - pp := filepath.Join(appPath, g.g.protoDir) + // All "cosmossdk.io" module packages must use SDK's + // proto path which is where the proto files are stored. + var pp string + if module.IsCosmosSDKModulePkg(appPath) { + pp = filepath.Join(g.g.sdkDir, "proto") + } else { + pp = filepath.Join(appPath, g.g.protoDir) + } return templateTSClientModule.Write(out, pp, struct { Module module.Module diff --git a/ignite/pkg/cosmosgen/generate_vuex.go b/ignite/pkg/cosmosgen/generate_vuex.go index d54436df5a..d39de1ac0b 100644 --- a/ignite/pkg/cosmosgen/generate_vuex.go +++ b/ignite/pkg/cosmosgen/generate_vuex.go @@ -11,9 +11,9 @@ import ( "github.com/imdario/mergo" "golang.org/x/sync/errgroup" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis/module" - "github.com/ignite/cli/ignite/pkg/gomodulepath" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/module" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" ) type vuexGenerator struct { diff --git a/ignite/pkg/cosmosgen/install.go b/ignite/pkg/cosmosgen/install.go index 4aa399f78c..159fd3b8a7 100644 --- a/ignite/pkg/cosmosgen/install.go +++ b/ignite/pkg/cosmosgen/install.go @@ -5,8 +5,8 @@ import ( "errors" "go/ast" - "github.com/ignite/cli/ignite/pkg/goanalysis" - "github.com/ignite/cli/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/goanalysis" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" ) // DepTools necessary tools to build and run the chain. diff --git a/ignite/pkg/cosmosgen/install_test.go b/ignite/pkg/cosmosgen/install_test.go index 919575feb8..222eadc22a 100644 --- a/ignite/pkg/cosmosgen/install_test.go +++ b/ignite/pkg/cosmosgen/install_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosgen" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" ) func TestMissingTools(t *testing.T) { diff --git a/ignite/pkg/cosmosgen/templates/module/index.ts.tpl b/ignite/pkg/cosmosgen/templates/module/index.ts.tpl index c9dfa159ec..11faba741d 100644 --- a/ignite/pkg/cosmosgen/templates/module/index.ts.tpl +++ b/ignite/pkg/cosmosgen/templates/module/index.ts.tpl @@ -1,6 +1,6 @@ -import Module from './module'; +import IgntModule from './module'; import { txClient, queryClient, registry } from './module'; import { msgTypes } from './registry'; export * from "./types"; -export { Module, msgTypes, txClient, queryClient, registry }; +export { IgntModule, msgTypes, txClient, queryClient, registry }; diff --git a/ignite/pkg/cosmosgen/templates/module/module.ts.tpl b/ignite/pkg/cosmosgen/templates/module/module.ts.tpl index 4797df2b06..abb378e19b 100644 --- a/ignite/pkg/cosmosgen/templates/module/module.ts.tpl +++ b/ignite/pkg/cosmosgen/templates/module/module.ts.tpl @@ -119,7 +119,7 @@ class SDKModule { } }; -const Module = (test: IgniteClient) => { +const IgntModule = (test: IgniteClient) => { return { module: { {{ camelCaseUpperSta .Module.Pkg.Name }}: new SDKModule(test) @@ -127,4 +127,4 @@ const Module = (test: IgniteClient) => { registry: msgTypes } } -export default Module; \ No newline at end of file +export default IgntModule; \ No newline at end of file diff --git a/ignite/pkg/cosmosgen/templates/root/client.ts.tpl b/ignite/pkg/cosmosgen/templates/root/client.ts.tpl index a7b30495b6..a9088ce67b 100644 --- a/ignite/pkg/cosmosgen/templates/root/client.ts.tpl +++ b/ignite/pkg/cosmosgen/templates/root/client.ts.tpl @@ -8,7 +8,7 @@ import { import { SigningStargateClient, StdFee } from "@cosmjs/stargate"; import { Env } from "./env"; import { UnionToIntersection, Return, Constructor } from "./helpers"; -import { Module } from "./modules"; +import { IgntModule } from "./modules"; import { EventEmitter } from "events"; import { ChainInfo } from "@keplr-wallet/types"; @@ -18,11 +18,11 @@ const defaultFee = { }; export class IgniteClient extends EventEmitter { - static plugins: Module[] = []; + static plugins: IgntModule[] = []; env: Env; signer?: OfflineSigner; registry: Array<[string, GeneratedType]> = []; - static plugin(plugin: T) { + static plugin(plugin: T) { const currentPlugins = this.plugins; class AugmentedClient extends this { diff --git a/ignite/pkg/cosmosgen/templates/root/index.ts.tpl b/ignite/pkg/cosmosgen/templates/root/index.ts.tpl index 8c71febfe1..b2cd682a81 100644 --- a/ignite/pkg/cosmosgen/templates/root/index.ts.tpl +++ b/ignite/pkg/cosmosgen/templates/root/index.ts.tpl @@ -2,7 +2,7 @@ import { Registry } from '@cosmjs/proto-signing' import { IgniteClient } from "./client"; import { MissingWalletError } from "./helpers"; -{{ range .Modules }}import { Module as {{ camelCaseUpperSta .Pkg.Name }}, msgTypes as {{ camelCaseUpperSta .Pkg.Name }}MsgTypes } from './{{ .Pkg.Name }}' +{{ range .Modules }}import { IgntModule as {{ camelCaseUpperSta .Pkg.Name }}, msgTypes as {{ camelCaseUpperSta .Pkg.Name }}MsgTypes } from './{{ .Pkg.Name }}' {{ end }} const Client = IgniteClient.plugin([ diff --git a/ignite/pkg/cosmosgen/templates/root/modules.ts.tpl b/ignite/pkg/cosmosgen/templates/root/modules.ts.tpl index 634b83c125..e8e4a78272 100644 --- a/ignite/pkg/cosmosgen/templates/root/modules.ts.tpl +++ b/ignite/pkg/cosmosgen/templates/root/modules.ts.tpl @@ -1,5 +1,5 @@ import { IgniteClient } from "./client"; import { GeneratedType } from "@cosmjs/proto-signing"; -export type ModuleInterface = { [key: string]: any } -export type Module = (instance: IgniteClient) => { module: ModuleInterface, registry: [string, GeneratedType][] } +export type IgntModuleInterface = { [key: string]: any } +export type IgntModule = (instance: IgniteClient) => { module: IgntModuleInterface, registry: [string, GeneratedType][] } diff --git a/ignite/pkg/cosmosgen/templates/root/package.json.tpl b/ignite/pkg/cosmosgen/templates/root/package.json.tpl index 8cd8cdea6b..189708e493 100644 --- a/ignite/pkg/cosmosgen/templates/root/package.json.tpl +++ b/ignite/pkg/cosmosgen/templates/root/package.json.tpl @@ -15,20 +15,19 @@ "access": "public" }, "scripts": { - "build": "NODE_OPTIONS='--max-old-space-size=16384' tsc", - "postinstall": "npm run build" + "build": "NODE_OPTIONS='--max-old-space-size=16384' tsc" }, "dependencies": { - "@cosmjs/proto-signing": "0.31.1", - "@cosmjs/stargate": "0.31.1", - "@keplr-wallet/types": "^0.11.3", + "@cosmjs/proto-signing": "0.32.1", + "@cosmjs/stargate": "0.32.1", + "@keplr-wallet/types": "^0.12.44", "axios": "0.21.4", "buffer": "^6.0.3", "events": "^3.3.0" }, "peerDependencies": { - "@cosmjs/proto-signing": "0.31.1", - "@cosmjs/stargate": "0.31.1" + "@cosmjs/proto-signing": "0.32.1", + "@cosmjs/stargate": "0.32.1" }, "devDependencies": { "@types/events": "^3.0.0", diff --git a/ignite/pkg/cosmosgen/webtemplates.go b/ignite/pkg/cosmosgen/webtemplates.go index 793d86b61c..ba60111f0f 100644 --- a/ignite/pkg/cosmosgen/webtemplates.go +++ b/ignite/pkg/cosmosgen/webtemplates.go @@ -3,7 +3,7 @@ package cosmosgen import ( webtemplates "github.com/ignite/web" - "github.com/ignite/cli/ignite/pkg/localfs" + "github.com/ignite/cli/v28/ignite/pkg/localfs" ) // React scaffolds a React app for a chain. diff --git a/ignite/pkg/cosmostxcollector/adapter/adapter.go b/ignite/pkg/cosmostxcollector/adapter/adapter.go index c3819884d0..3f769d73d6 100644 --- a/ignite/pkg/cosmostxcollector/adapter/adapter.go +++ b/ignite/pkg/cosmostxcollector/adapter/adapter.go @@ -3,8 +3,8 @@ package adapter import ( "context" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/query" ) // Saver is the interface that wraps the transactions save method. diff --git a/ignite/pkg/cosmostxcollector/adapter/postgres/filters_test.go b/ignite/pkg/cosmostxcollector/adapter/postgres/filters_test.go index 07cd7b7afd..ace13b742a 100644 --- a/ignite/pkg/cosmostxcollector/adapter/postgres/filters_test.go +++ b/ignite/pkg/cosmostxcollector/adapter/postgres/filters_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/adapter/postgres" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/adapter/postgres" ) func TestFilter(t *testing.T) { diff --git a/ignite/pkg/cosmostxcollector/adapter/postgres/parsers.go b/ignite/pkg/cosmostxcollector/adapter/postgres/parsers.go index b8717823bc..67fd83f437 100644 --- a/ignite/pkg/cosmostxcollector/adapter/postgres/parsers.go +++ b/ignite/pkg/cosmostxcollector/adapter/postgres/parsers.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/query" ) const ( diff --git a/ignite/pkg/cosmostxcollector/adapter/postgres/postgres.go b/ignite/pkg/cosmostxcollector/adapter/postgres/postgres.go index 9a008ac871..882f9898d7 100644 --- a/ignite/pkg/cosmostxcollector/adapter/postgres/postgres.go +++ b/ignite/pkg/cosmostxcollector/adapter/postgres/postgres.go @@ -12,8 +12,8 @@ import ( ctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/lib/pq" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/query" ) const ( diff --git a/ignite/pkg/cosmostxcollector/adapter/postgres/postgres_test.go b/ignite/pkg/cosmostxcollector/adapter/postgres/postgres_test.go index c6df9f83f8..d6f756ddf2 100644 --- a/ignite/pkg/cosmostxcollector/adapter/postgres/postgres_test.go +++ b/ignite/pkg/cosmostxcollector/adapter/postgres/postgres_test.go @@ -17,8 +17,8 @@ import ( "github.com/lib/pq" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/query" ) var ( diff --git a/ignite/pkg/cosmostxcollector/adapter/postgres/schemas_test.go b/ignite/pkg/cosmostxcollector/adapter/postgres/schemas_test.go index 268449d4fe..0a6b6e8a17 100644 --- a/ignite/pkg/cosmostxcollector/adapter/postgres/schemas_test.go +++ b/ignite/pkg/cosmostxcollector/adapter/postgres/schemas_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/adapter/postgres" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/adapter/postgres" ) func TestSchemasWalk(t *testing.T) { diff --git a/ignite/pkg/cosmostxcollector/collector.go b/ignite/pkg/cosmostxcollector/collector.go index 525d53ede5..75c9e6791e 100644 --- a/ignite/pkg/cosmostxcollector/collector.go +++ b/ignite/pkg/cosmostxcollector/collector.go @@ -5,8 +5,8 @@ import ( "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/adapter" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/adapter" ) // TXsCollector defines the interface for Cosmos clients that support collection of transactions. diff --git a/ignite/pkg/cosmostxcollector/collector_test.go b/ignite/pkg/cosmostxcollector/collector_test.go index 266a59d544..15d84b2c43 100644 --- a/ignite/pkg/cosmostxcollector/collector_test.go +++ b/ignite/pkg/cosmostxcollector/collector_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/mocks" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/mocks" ) func TestCollector(t *testing.T) { diff --git a/ignite/pkg/cosmostxcollector/mocks/saver.go b/ignite/pkg/cosmostxcollector/mocks/saver.go index f468eb112f..816c691e2b 100644 --- a/ignite/pkg/cosmostxcollector/mocks/saver.go +++ b/ignite/pkg/cosmostxcollector/mocks/saver.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - cosmosclient "github.com/ignite/cli/ignite/pkg/cosmosclient" + cosmosclient "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" ) // Saver is an autogenerated mock type for the Saver type diff --git a/ignite/pkg/cosmostxcollector/mocks/txs_collector.go b/ignite/pkg/cosmostxcollector/mocks/txs_collector.go index c1a71eafe4..0a1a3f46e3 100644 --- a/ignite/pkg/cosmostxcollector/mocks/txs_collector.go +++ b/ignite/pkg/cosmostxcollector/mocks/txs_collector.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - cosmosclient "github.com/ignite/cli/ignite/pkg/cosmosclient" + cosmosclient "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" mock "github.com/stretchr/testify/mock" ) diff --git a/ignite/pkg/cosmostxcollector/query/query_test.go b/ignite/pkg/cosmostxcollector/query/query_test.go index e4a786a1ba..48f285339d 100644 --- a/ignite/pkg/cosmostxcollector/query/query_test.go +++ b/ignite/pkg/cosmostxcollector/query/query_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmostxcollector/query" + "github.com/ignite/cli/v28/ignite/pkg/cosmostxcollector/query" ) func TestQuery(t *testing.T) { diff --git a/ignite/pkg/cosmosutil/address_test.go b/ignite/pkg/cosmosutil/address_test.go index a24f055ab7..ae1700b1b0 100644 --- a/ignite/pkg/cosmosutil/address_test.go +++ b/ignite/pkg/cosmosutil/address_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosutil" + "github.com/ignite/cli/v28/ignite/pkg/cosmosutil" ) func TestChangePrefix(t *testing.T) { diff --git a/ignite/pkg/cosmosutil/genesis/genesis.go b/ignite/pkg/cosmosutil/genesis/genesis.go index 7f707e1e5e..3e244be532 100644 --- a/ignite/pkg/cosmosutil/genesis/genesis.go +++ b/ignite/pkg/cosmosutil/genesis/genesis.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "github.com/ignite/cli/ignite/pkg/jsonfile" + "github.com/ignite/cli/v28/ignite/pkg/jsonfile" ) const ( diff --git a/ignite/pkg/cosmosutil/genesis/genesis_test.go b/ignite/pkg/cosmosutil/genesis/genesis_test.go index 6fe0d3179c..ed9b11d810 100644 --- a/ignite/pkg/cosmosutil/genesis/genesis_test.go +++ b/ignite/pkg/cosmosutil/genesis/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - cosmosgenesis "github.com/ignite/cli/ignite/pkg/cosmosutil/genesis" + cosmosgenesis "github.com/ignite/cli/v28/ignite/pkg/cosmosutil/genesis" ) func TestModuleParamField(t *testing.T) { diff --git a/ignite/pkg/cosmosutil/gentx_test.go b/ignite/pkg/cosmosutil/gentx_test.go index 0cfb83781b..d6c72d42cf 100644 --- a/ignite/pkg/cosmosutil/gentx_test.go +++ b/ignite/pkg/cosmosutil/gentx_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosutil" + "github.com/ignite/cli/v28/ignite/pkg/cosmosutil" ) func TestParseGentx(t *testing.T) { diff --git a/ignite/pkg/cosmosver/detect.go b/ignite/pkg/cosmosver/detect.go index f280084829..1be3f53537 100644 --- a/ignite/pkg/cosmosver/detect.go +++ b/ignite/pkg/cosmosver/detect.go @@ -1,7 +1,7 @@ package cosmosver import ( - "github.com/ignite/cli/ignite/pkg/gomodule" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" ) const ( diff --git a/ignite/pkg/dirchange/dirchange.go b/ignite/pkg/dirchange/dirchange.go index bf5f26c513..38000970fa 100644 --- a/ignite/pkg/dirchange/dirchange.go +++ b/ignite/pkg/dirchange/dirchange.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/ignite/cli/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cache" ) var ErrNoFile = errors.New("no file in specified paths") diff --git a/ignite/pkg/dirchange/dirchange_test.go b/ignite/pkg/dirchange/dirchange_test.go index 73e49c6bb1..d086454164 100644 --- a/ignite/pkg/dirchange/dirchange_test.go +++ b/ignite/pkg/dirchange/dirchange_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/dirchange" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/dirchange" ) const ( diff --git a/ignite/pkg/env/env.go b/ignite/pkg/env/env.go index 25c66fe152..40503c65fc 100644 --- a/ignite/pkg/env/env.go +++ b/ignite/pkg/env/env.go @@ -5,7 +5,7 @@ import ( "os" "path" - "github.com/ignite/cli/ignite/pkg/xfilepath" + "github.com/ignite/cli/v28/ignite/pkg/xfilepath" ) const ( diff --git a/ignite/pkg/events/bus.go b/ignite/pkg/events/bus.go index 2df16f19b0..c95fa87e75 100644 --- a/ignite/pkg/events/bus.go +++ b/ignite/pkg/events/bus.go @@ -3,7 +3,7 @@ package events import ( "fmt" - "github.com/ignite/cli/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" ) // DefaultBufferSize defines the default maximum number diff --git a/ignite/pkg/events/bus_test.go b/ignite/pkg/events/bus_test.go index d16c0b40fb..faa7076136 100644 --- a/ignite/pkg/events/bus_test.go +++ b/ignite/pkg/events/bus_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/events" ) func TestBusSend(t *testing.T) { diff --git a/ignite/pkg/events/events_test.go b/ignite/pkg/events/events_test.go index 15e8d2f0ed..15157ed752 100644 --- a/ignite/pkg/events/events_test.go +++ b/ignite/pkg/events/events_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/events" ) func TestNew(t *testing.T) { diff --git a/ignite/pkg/gacli/gacli.go b/ignite/pkg/gacli/gacli.go index 7237bcd50b..3aaf020678 100644 --- a/ignite/pkg/gacli/gacli.go +++ b/ignite/pkg/gacli/gacli.go @@ -29,12 +29,11 @@ type ( } // Metric represents a data point. Metric struct { - Status string `json:"status,omitempty"` + Name string `json:"name,omitempty"` + Cmd string `json:"command,omitempty"` + Tag string `json:"tag,omitempty"` OS string `json:"os,omitempty"` Arch string `json:"arch,omitempty"` - FullCmd string `json:"full_command,omitempty"` - Cmd string `json:"command,omitempty"` - Error string `json:"error,omitempty"` Version string `json:"version,omitempty"` SessionID string `json:"session_id,omitempty"` EngagementTimeMsec string `json:"engagement_time_msec,omitempty"` diff --git a/ignite/pkg/gitpod/gitpod.go b/ignite/pkg/gitpod/gitpod.go index b359799538..2f4e8f88c9 100644 --- a/ignite/pkg/gitpod/gitpod.go +++ b/ignite/pkg/gitpod/gitpod.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/ignite/cli/ignite/pkg/cmdrunner/exec" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" ) // IsOnGitpod reports whether if running on Gitpod or not. diff --git a/ignite/pkg/goanalysis/goanalysis_test.go b/ignite/pkg/goanalysis/goanalysis_test.go index ecad20b1d2..c562080eb5 100644 --- a/ignite/pkg/goanalysis/goanalysis_test.go +++ b/ignite/pkg/goanalysis/goanalysis_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/tools/go/ast/astutil" - "github.com/ignite/cli/ignite/pkg/goanalysis" - "github.com/ignite/cli/ignite/pkg/xast" + "github.com/ignite/cli/v28/ignite/pkg/goanalysis" + "github.com/ignite/cli/v28/ignite/pkg/xast" ) var MainFile = []byte(`package main`) diff --git a/ignite/pkg/gocmd/gocmd.go b/ignite/pkg/gocmd/gocmd.go index f9a99c7330..98b86b03f8 100644 --- a/ignite/pkg/gocmd/gocmd.go +++ b/ignite/pkg/gocmd/gocmd.go @@ -9,9 +9,9 @@ import ( "path/filepath" "strings" - "github.com/ignite/cli/ignite/pkg/cmdrunner/exec" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/goenv" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/goenv" ) const ( @@ -33,6 +33,9 @@ const ( // CommandModVerify represents go mod "verify" command. CommandModVerify = "verify" + // CommandModDownload represents go mod "download" command. + CommandModDownload = "download" + // CommandFmt represents go "fmt" command. CommandFmt = "fmt" @@ -105,6 +108,15 @@ func ModVerify(ctx context.Context, path string, options ...exec.Option) error { return exec.Exec(ctx, []string{Name(), CommandMod, CommandModVerify}, append(options, exec.StepOption(step.Workdir(path)))...) } +// ModDownload runs go mod download on a path with options. +func ModDownload(ctx context.Context, path string, json bool, options ...exec.Option) error { + command := []string{Name(), CommandMod, CommandModDownload} + if json { + command = append(command, "-json") + } + return exec.Exec(ctx, command, append(options, exec.StepOption(step.Workdir(path)))...) +} + // BuildPath runs go install on cmd folder with options. func BuildPath(ctx context.Context, output, binary, path string, flags []string, options ...exec.Option) error { binaryOutput, err := binaryPath(output, binary) diff --git a/ignite/pkg/gocmd/gocmd_test.go b/ignite/pkg/gocmd/gocmd_test.go index e1baae53a9..511994f5f1 100644 --- a/ignite/pkg/gocmd/gocmd_test.go +++ b/ignite/pkg/gocmd/gocmd_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/ignite/cli/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" ) func TestIsInstallError(t *testing.T) { @@ -24,8 +24,8 @@ func TestList(t *testing.T) { assert.NoError(t, err) ctx := context.Background() - packages, err := gocmd.List(ctx, wd, []string{"-m", "-f={{.Path}}", "github.com/ignite/cli"}) + packages, err := gocmd.List(ctx, wd, []string{"-m", "-f={{.Path}}", "github.com/ignite/cli/v28"}) assert.NoError(t, err) - assert.Contains(t, packages, "github.com/ignite/cli") + assert.Contains(t, packages, "github.com/ignite/cli/v28") } diff --git a/ignite/pkg/goenv/goenv_test.go b/ignite/pkg/goenv/goenv_test.go index c4c9429bed..50bfc1dbc6 100644 --- a/ignite/pkg/goenv/goenv_test.go +++ b/ignite/pkg/goenv/goenv_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/goenv" + "github.com/ignite/cli/v28/ignite/pkg/goenv" ) func TestGoModCache(t *testing.T) { diff --git a/ignite/pkg/gomodule/gomodule.go b/ignite/pkg/gomodule/gomodule.go index 1418079fcb..f17bacdcda 100644 --- a/ignite/pkg/gomodule/gomodule.go +++ b/ignite/pkg/gomodule/gomodule.go @@ -10,19 +10,41 @@ import ( "io/fs" "os" "path/filepath" + "strings" "golang.org/x/mod/modfile" "golang.org/x/mod/module" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" ) const pathCacheNamespace = "gomodule.path" -// ErrGoModNotFound returned when go.mod file cannot be found for an app. -var ErrGoModNotFound = errors.New("go.mod not found") +var ( + // ErrGoModNotFound returned when go.mod file cannot be found for an app. + ErrGoModNotFound = errors.New("go.mod not found") + + // ErrModuleNotFound is returned when a Go module is not found. + ErrModuleNotFound = errors.New("module not found") +) + +// Version is an alias to the module version type. +type Version = module.Version + +// Module contains Go module info. +type Module struct { + // Path is the Go module path. + Path string + + // Version is the module version. + Version string + + // Dir is the absolute path to the Go module. + Dir string +} // ParseAt finds and parses go.mod at app's path. func ParseAt(path string) (*modfile.File, error) { @@ -37,8 +59,8 @@ func ParseAt(path string) (*modfile.File, error) { } // FilterVersions filters dependencies under require section by their paths. -func FilterVersions(dependencies []module.Version, paths ...string) []module.Version { - var filtered []module.Version +func FilterVersions(dependencies []Version, paths ...string) []Version { + var filtered []Version for _, dep := range dependencies { for _, path := range paths { @@ -52,10 +74,10 @@ func FilterVersions(dependencies []module.Version, paths ...string) []module.Ver return filtered } -func ResolveDependencies(f *modfile.File, includeIndirect bool) ([]module.Version, error) { - var versions []module.Version +func ResolveDependencies(f *modfile.File, includeIndirect bool) ([]Version, error) { + var versions []Version - isReplacementAdded := func(rv module.Version) bool { + isReplacementAdded := func(rv Version) bool { for _, rep := range f.Replace { if rv.Path == rep.Old.Path { versions = append(versions, rep.New) @@ -80,7 +102,7 @@ func ResolveDependencies(f *modfile.File, includeIndirect bool) ([]module.Versio } // LocatePath locates pkg's absolute path managed by 'go mod' on the local filesystem. -func LocatePath(ctx context.Context, cacheStorage cache.Storage, src string, pkg module.Version) (path string, err error) { +func LocatePath(ctx context.Context, cacheStorage cache.Storage, src string, pkg Version) (path string, err error) { // can be a local package. if pkg.Version == "" { // indicates that this is a local package. if filepath.IsAbs(pkg.Path) { @@ -100,37 +122,72 @@ func LocatePath(ctx context.Context, cacheStorage cache.Storage, src string, pkg } // otherwise, it is hosted. - out := &bytes.Buffer{} - - if err := cmdrunner. - New(). - Run(ctx, step.New( - step.Exec("go", "mod", "download", "-json"), - step.Workdir(src), - step.Stdout(out), - )); err != nil { + m, err := FindModule(ctx, src, pkg.String()) + if err != nil { return "", err } - d := json.NewDecoder(out) + if err = pathCache.Put(cacheKey, m.Dir); err != nil { + return "", err + } + return m.Dir, nil +} - for { - var mod struct { - Path, Version, Dir string - } - if err := d.Decode(&mod); err != nil { +// SplitPath splits a Go import path into an URI path and version. +// Version is an empty string when the path doesn't contain a version suffix. +// Versioned paths use the "path@version" format. +func SplitPath(path string) (string, string) { + if len(path) == 0 || path[0] == '@' { + return "", "" + } + + parts := strings.SplitN(path, "@", 2) + if len(parts) == 2 { + return parts[0], parts[1] + } + return parts[0], "" +} + +// JoinPath joins a Go import path URI to a version. +// The result path have the "path@version" format. +func JoinPath(path, version string) string { + if path == "" { + return "" + } + + if version == "" { + return path + } + + return fmt.Sprintf("%s@%s", path, version) +} + +// FindModule returns the Go module info for an import path. +// The module is searched within the dependencies of the module defined in root dir. +func FindModule(ctx context.Context, rootDir, path string) (Module, error) { + var stdout bytes.Buffer + err := gocmd.ModDownload(ctx, rootDir, true, exec.StepOption(step.Stdout(&stdout))) + if err != nil { + return Module{}, err + } + + dec := json.NewDecoder(&stdout) + p, version := SplitPath(path) + + for dec.More() { + var m Module + if dec.Decode(&m); err != nil { if errors.Is(err, io.EOF) { break } - return "", err + + return Module{}, err } - if mod.Path == pkg.Path && mod.Version == pkg.Version { - if err := pathCache.Put(cacheKey, mod.Dir); err != nil { - return "", err - } - return mod.Dir, nil + + if m.Path == p && (version == "" || version == m.Version) { + return m, nil } } - return "", fmt.Errorf("module %q not found", pkg.Path) + return Module{}, fmt.Errorf("%w: %s", ErrModuleNotFound, path) } diff --git a/ignite/pkg/gomodule/gomodule_test.go b/ignite/pkg/gomodule/gomodule_test.go new file mode 100644 index 0000000000..8c3cb19228 --- /dev/null +++ b/ignite/pkg/gomodule/gomodule_test.go @@ -0,0 +1,98 @@ +package gomodule_test + +import ( + "context" + "strings" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/ignite/cli/v28/ignite/pkg/gomodule" +) + +func TestSplitPath(t *testing.T) { + cases := []struct { + name string + path string + wantPath string + wantVersion string + }{ + { + name: "path with version", + path: "foo@v0.1.0", + wantPath: "foo", + wantVersion: "v0.1.0", + }, + { + name: "path without version", + path: "foo", + wantPath: "foo", + }, + { + name: "invalid path", + path: "@v0.1.0", + }, + { + name: "empty path", + }, + } + + for _, tt := range cases { + t.Run(tt.name, func(t *testing.T) { + // Act + p, v := gomodule.SplitPath(tt.path) + + // Assert + require.Equal(t, tt.wantPath, p) + require.Equal(t, tt.wantVersion, v) + }) + } +} + +func TestJoinPath(t *testing.T) { + require.Equal(t, "foo@v0.1.0", gomodule.JoinPath("foo", "v0.1.0")) + require.Equal(t, "", gomodule.JoinPath("", "v0.1.0")) + require.Equal(t, "foo", gomodule.JoinPath("foo", "")) +} + +func TestFindModule(t *testing.T) { + cases := []struct { + name string + importPath string + version string + wantErr error + }{ + { + name: "module exists", + importPath: "github.com/gorilla/mux", + version: "v1.8.0", + }, + { + name: "module missing", + importPath: "github.com/foo/bar", + version: "v0.1.0", + wantErr: gomodule.ErrModuleNotFound, + }, + } + + for _, tt := range cases { + t.Run(tt.name, func(t *testing.T) { + // Arrange + ctx := context.Background() + path := gomodule.JoinPath(tt.importPath, tt.version) + + // Act + m, err := gomodule.FindModule(ctx, "testdata/module", path) + + // Assert + if tt.wantErr != nil { + require.ErrorIs(t, err, tt.wantErr) + } else { + require.NoError(t, err) + require.Equal(t, tt.importPath, m.Path) + require.Equal(t, tt.version, m.Version) + require.True(t, strings.HasSuffix(m.Dir, path)) + } + }) + } +} diff --git a/ignite/pkg/gomodule/testdata/module/go.mod b/ignite/pkg/gomodule/testdata/module/go.mod new file mode 100644 index 0000000000..6b0c1f1e4c --- /dev/null +++ b/ignite/pkg/gomodule/testdata/module/go.mod @@ -0,0 +1,8 @@ +module github.com/ignite/cli/ignite/pkg/gomodule + +go 1.21.0 + +require ( + github.com/gorilla/mux v1.8.0 + github.com/stretchr/testify v1.8.2 +) diff --git a/ignite/pkg/gomodulepath/gomodulepath.go b/ignite/pkg/gomodulepath/gomodulepath.go index 707104081f..ea4a87a772 100644 --- a/ignite/pkg/gomodulepath/gomodulepath.go +++ b/ignite/pkg/gomodulepath/gomodulepath.go @@ -16,7 +16,7 @@ import ( "golang.org/x/mod/module" "golang.org/x/mod/semver" - "github.com/ignite/cli/ignite/pkg/gomodule" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" ) // Path represents a Go module's path. diff --git a/ignite/pkg/gomodulepath/gomodulepath_test.go b/ignite/pkg/gomodulepath/gomodulepath_test.go index d13b7fcd1b..19b81099f1 100644 --- a/ignite/pkg/gomodulepath/gomodulepath_test.go +++ b/ignite/pkg/gomodulepath/gomodulepath_test.go @@ -171,7 +171,7 @@ func TestExtractAppPath(t *testing.T) { } func TestValidateURIPath(t *testing.T) { - require.NoError(t, validateURIPath("github.com/ignite/cli")) + require.NoError(t, validateURIPath("github.com/ignite/cli/v28")) } func TestValidateURIPathWithInvalidPath(t *testing.T) { diff --git a/ignite/pkg/jsonfile/jsonfile.go b/ignite/pkg/jsonfile/jsonfile.go index 7ee796be6b..7b6e7788a1 100644 --- a/ignite/pkg/jsonfile/jsonfile.go +++ b/ignite/pkg/jsonfile/jsonfile.go @@ -17,7 +17,7 @@ import ( "github.com/buger/jsonparser" "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/tarball" + "github.com/ignite/cli/v28/ignite/pkg/tarball" ) const ( diff --git a/ignite/pkg/jsonfile/jsonfile_test.go b/ignite/pkg/jsonfile/jsonfile_test.go index a1be81db34..06e39983f7 100644 --- a/ignite/pkg/jsonfile/jsonfile_test.go +++ b/ignite/pkg/jsonfile/jsonfile_test.go @@ -16,7 +16,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/tarball" + "github.com/ignite/cli/v28/ignite/pkg/tarball" ) func TestJSONFile_Field(t *testing.T) { diff --git a/ignite/pkg/multiformatname/multiformatname.go b/ignite/pkg/multiformatname/multiformatname.go index dcfae383a3..7fb192c3a0 100644 --- a/ignite/pkg/multiformatname/multiformatname.go +++ b/ignite/pkg/multiformatname/multiformatname.go @@ -8,7 +8,7 @@ import ( "github.com/iancoleman/strcase" - "github.com/ignite/cli/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) // Name represents a name with multiple naming convention representations. diff --git a/ignite/pkg/multiformatname/multiformatname_test.go b/ignite/pkg/multiformatname/multiformatname_test.go index db708366e7..3a16242f07 100644 --- a/ignite/pkg/multiformatname/multiformatname_test.go +++ b/ignite/pkg/multiformatname/multiformatname_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" ) func TestNewMultiFormatName(t *testing.T) { diff --git a/ignite/pkg/nodetime/nodetime.go b/ignite/pkg/nodetime/nodetime.go index c593017c66..65569fbf7d 100644 --- a/ignite/pkg/nodetime/nodetime.go +++ b/ignite/pkg/nodetime/nodetime.go @@ -12,7 +12,7 @@ import ( "github.com/ignite/ignite-files/nodetime" - "github.com/ignite/cli/ignite/pkg/localfs" + "github.com/ignite/cli/v28/ignite/pkg/localfs" ) // the list of CLIs included. diff --git a/ignite/pkg/nodetime/programs/sta/sta.go b/ignite/pkg/nodetime/programs/sta/sta.go index 2cfe7b1300..b89acd778f 100644 --- a/ignite/pkg/nodetime/programs/sta/sta.go +++ b/ignite/pkg/nodetime/programs/sta/sta.go @@ -6,8 +6,8 @@ import ( "os" "path/filepath" - "github.com/ignite/cli/ignite/pkg/cmdrunner/exec" - "github.com/ignite/cli/ignite/pkg/nodetime" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/nodetime" ) // Option configures Generate configs. diff --git a/ignite/pkg/nodetime/programs/swagger-combine/swagger-combine.go b/ignite/pkg/nodetime/programs/swagger-combine/swagger-combine.go index 2b0c3da375..285f229e46 100644 --- a/ignite/pkg/nodetime/programs/swagger-combine/swagger-combine.go +++ b/ignite/pkg/nodetime/programs/swagger-combine/swagger-combine.go @@ -7,7 +7,7 @@ import ( "os" "regexp" - "github.com/ignite/cli/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" ) // Config represent swagger-combine config. diff --git a/ignite/pkg/nodetime/programs/ts-proto/tsproto.go b/ignite/pkg/nodetime/programs/ts-proto/tsproto.go index 9b7944ab56..5aa14a700c 100644 --- a/ignite/pkg/nodetime/programs/ts-proto/tsproto.go +++ b/ignite/pkg/nodetime/programs/ts-proto/tsproto.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - "github.com/ignite/cli/ignite/pkg/nodetime" + "github.com/ignite/cli/v28/ignite/pkg/nodetime" ) const ( diff --git a/ignite/pkg/nodetime/programs/ts-relayer/tsrelayer.go b/ignite/pkg/nodetime/programs/ts-relayer/tsrelayer.go index a385c70ec2..5767b3d829 100644 --- a/ignite/pkg/nodetime/programs/ts-relayer/tsrelayer.go +++ b/ignite/pkg/nodetime/programs/ts-relayer/tsrelayer.go @@ -11,9 +11,9 @@ import ( "github.com/gorilla/rpc/v2/json2" "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/nodetime" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/nodetime" ) // Call calls a method in the ts relayer wrapper lib with args and fills reply from the returned value. diff --git a/ignite/pkg/placeholder/error.go b/ignite/pkg/placeholder/error.go index a2fe398a42..22ff74de2d 100644 --- a/ignite/pkg/placeholder/error.go +++ b/ignite/pkg/placeholder/error.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/ignite/cli/ignite/pkg/validation" + "github.com/ignite/cli/v28/ignite/pkg/validation" ) var _ validation.Error = (*MissingPlaceholdersError)(nil) diff --git a/ignite/pkg/protoanalysis/parser.go b/ignite/pkg/protoanalysis/parser.go index ea3d448089..98f209dcd7 100644 --- a/ignite/pkg/protoanalysis/parser.go +++ b/ignite/pkg/protoanalysis/parser.go @@ -8,7 +8,7 @@ import ( "github.com/emicklei/proto" "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/localfs" + "github.com/ignite/cli/v28/ignite/pkg/localfs" ) const optionGoPkg = "go_package" diff --git a/ignite/pkg/protoanalysis/protoutil/creator_test.go b/ignite/pkg/protoanalysis/protoutil/creator_test.go index 7fc36d9885..afdbbb8202 100644 --- a/ignite/pkg/protoanalysis/protoutil/creator_test.go +++ b/ignite/pkg/protoanalysis/protoutil/creator_test.go @@ -6,7 +6,7 @@ import ( "github.com/emicklei/proto" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" ) // Imports. diff --git a/ignite/pkg/protoc/protoc.go b/ignite/pkg/protoc/protoc.go index c8f8c726be..0a952ed5c0 100644 --- a/ignite/pkg/protoc/protoc.go +++ b/ignite/pkg/protoc/protoc.go @@ -14,10 +14,10 @@ import ( "github.com/ignite/ignite-files/protoc" - "github.com/ignite/cli/ignite/pkg/cmdrunner/exec" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/localfs" - "github.com/ignite/cli/ignite/pkg/protoanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/localfs" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis" ) // Option configures Generate configs. diff --git a/ignite/pkg/relayer/chain.go b/ignite/pkg/relayer/chain.go index 41c0756e07..e16c4bf6f1 100644 --- a/ignite/pkg/relayer/chain.go +++ b/ignite/pkg/relayer/chain.go @@ -8,10 +8,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/imdario/mergo" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmosfaucet" - relayerconfig "github.com/ignite/cli/ignite/pkg/relayer/config" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" + relayerconfig "github.com/ignite/cli/v28/ignite/pkg/relayer/config" ) const ( diff --git a/ignite/pkg/relayer/config/config.go b/ignite/pkg/relayer/config/config.go index bd0949e0a6..6444b54ab5 100644 --- a/ignite/pkg/relayer/config/config.go +++ b/ignite/pkg/relayer/config/config.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/confile" + "github.com/ignite/cli/v28/ignite/pkg/confile" ) const SupportVersion = "2" diff --git a/ignite/pkg/relayer/relayer.go b/ignite/pkg/relayer/relayer.go index deedd8ceea..89cc494b98 100644 --- a/ignite/pkg/relayer/relayer.go +++ b/ignite/pkg/relayer/relayer.go @@ -14,12 +14,12 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/ctxticker" - tsrelayer "github.com/ignite/cli/ignite/pkg/nodetime/programs/ts-relayer" - relayerconf "github.com/ignite/cli/ignite/pkg/relayer/config" - "github.com/ignite/cli/ignite/pkg/xurl" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/ctxticker" + tsrelayer "github.com/ignite/cli/v28/ignite/pkg/nodetime/programs/ts-relayer" + relayerconf "github.com/ignite/cli/v28/ignite/pkg/relayer/config" + "github.com/ignite/cli/v28/ignite/pkg/xurl" ) const ( diff --git a/ignite/pkg/xast/xast_test.go b/ignite/pkg/xast/xast_test.go index 2a18ccaee7..ad3992767e 100644 --- a/ignite/pkg/xast/xast_test.go +++ b/ignite/pkg/xast/xast_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xast" + "github.com/ignite/cli/v28/ignite/pkg/xast" ) func TestInspect(t *testing.T) { diff --git a/ignite/pkg/xexec/xexec.go b/ignite/pkg/xexec/xexec.go index 51defd9486..db72286b47 100644 --- a/ignite/pkg/xexec/xexec.go +++ b/ignite/pkg/xexec/xexec.go @@ -5,7 +5,7 @@ import ( "os/exec" "path/filepath" - "github.com/ignite/cli/ignite/pkg/goenv" + "github.com/ignite/cli/v28/ignite/pkg/goenv" ) // IsExec checks if a file is executable by anyone. diff --git a/ignite/pkg/xexec/xexec_test.go b/ignite/pkg/xexec/xexec_test.go index e55c1eddca..17365f6405 100644 --- a/ignite/pkg/xexec/xexec_test.go +++ b/ignite/pkg/xexec/xexec_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xexec" + "github.com/ignite/cli/v28/ignite/pkg/xexec" ) func TestIsExec(t *testing.T) { diff --git a/ignite/pkg/xfilepath/xfilepath_test.go b/ignite/pkg/xfilepath/xfilepath_test.go index 40243bb5a8..f8f2d1cfb5 100644 --- a/ignite/pkg/xfilepath/xfilepath_test.go +++ b/ignite/pkg/xfilepath/xfilepath_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xfilepath" + "github.com/ignite/cli/v28/ignite/pkg/xfilepath" ) func TestJoin(t *testing.T) { diff --git a/ignite/pkg/xgenny/run.go b/ignite/pkg/xgenny/run.go index d81ab79619..604150018f 100644 --- a/ignite/pkg/xgenny/run.go +++ b/ignite/pkg/xgenny/run.go @@ -10,8 +10,8 @@ import ( "github.com/gobuffalo/logger" "github.com/gobuffalo/packd" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/validation" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/validation" ) var _ validation.Error = (*dryRunError)(nil) diff --git a/ignite/pkg/xgenny/sourcemodification_test.go b/ignite/pkg/xgenny/sourcemodification_test.go index 508fce28ee..5dcb380ebb 100644 --- a/ignite/pkg/xgenny/sourcemodification_test.go +++ b/ignite/pkg/xgenny/sourcemodification_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" ) var ( diff --git a/ignite/pkg/xgenny/xgenny_test.go b/ignite/pkg/xgenny/xgenny_test.go index d9c8e48b99..442dd3b63b 100644 --- a/ignite/pkg/xgenny/xgenny_test.go +++ b/ignite/pkg/xgenny/xgenny_test.go @@ -9,7 +9,7 @@ import ( "github.com/gobuffalo/plush/v4" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" ) func Test_Transformer(t *testing.T) { diff --git a/ignite/pkg/xgit/xgit_test.go b/ignite/pkg/xgit/xgit_test.go index 3cc9b7b9db..dca65807d6 100644 --- a/ignite/pkg/xgit/xgit_test.go +++ b/ignite/pkg/xgit/xgit_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/randstr" - "github.com/ignite/cli/ignite/pkg/xgit" + "github.com/ignite/cli/v28/ignite/pkg/randstr" + "github.com/ignite/cli/v28/ignite/pkg/xgit" ) func TestInitAndCommit(t *testing.T) { diff --git a/ignite/pkg/xnet/xnet_test.go b/ignite/pkg/xnet/xnet_test.go index 3375eba057..360234dacc 100644 --- a/ignite/pkg/xnet/xnet_test.go +++ b/ignite/pkg/xnet/xnet_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xnet" + "github.com/ignite/cli/v28/ignite/pkg/xnet" ) func TestLocalhostIPv4Address(t *testing.T) { diff --git a/ignite/pkg/xos/cp_test.go b/ignite/pkg/xos/cp_test.go index a86329db58..11556b60b3 100644 --- a/ignite/pkg/xos/cp_test.go +++ b/ignite/pkg/xos/cp_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xos" + "github.com/ignite/cli/v28/ignite/pkg/xos" ) func TestCopyFolder(t *testing.T) { diff --git a/ignite/pkg/xos/files_test.go b/ignite/pkg/xos/files_test.go index fa5fe54f98..d5da93e5e5 100644 --- a/ignite/pkg/xos/files_test.go +++ b/ignite/pkg/xos/files_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xos" + "github.com/ignite/cli/v28/ignite/pkg/xos" ) func TestFindFiles(t *testing.T) { diff --git a/ignite/pkg/xos/mv_test.go b/ignite/pkg/xos/mv_test.go index c991d31b6d..4bb761c7ac 100644 --- a/ignite/pkg/xos/mv_test.go +++ b/ignite/pkg/xos/mv_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xos" + "github.com/ignite/cli/v28/ignite/pkg/xos" ) func TestRename(t *testing.T) { diff --git a/ignite/pkg/xstrings/xstrings.go b/ignite/pkg/xstrings/xstrings.go index ff038a95db..7924443e33 100644 --- a/ignite/pkg/xstrings/xstrings.go +++ b/ignite/pkg/xstrings/xstrings.go @@ -70,3 +70,25 @@ func Title(s string) string { func ToUpperFirst(s string) string { return strings.ToUpper(s[:1]) + s[1:] } + +// StringBetween returns the string between two other strings. +// The comparison is not greedy so the between result includes the +// string between the start value and the first match of the end value. +func StringBetween(s, start, end string) string { + if s == "" || start == "" || end == "" { + return "" + } + + i := strings.Index(s, start) + if i == -1 { + return "" + } + + s = s[i+len(start):] + i = strings.Index(s, end) + if i == -1 { + return "" + } + + return s[:i] +} diff --git a/ignite/pkg/xstrings/xstrings_test.go b/ignite/pkg/xstrings/xstrings_test.go index c2da08be2c..ea52b956df 100644 --- a/ignite/pkg/xstrings/xstrings_test.go +++ b/ignite/pkg/xstrings/xstrings_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) func TestNoDash(t *testing.T) { @@ -18,3 +18,11 @@ func TestNoNumberPrefix(t *testing.T) { require.Equal(t, "_0foo", xstrings.NoNumberPrefix("0foo")) require.Equal(t, "_999foo", xstrings.NoNumberPrefix("999foo")) } + +func TestStringBetween(t *testing.T) { + require.Equal(t, "bar", xstrings.StringBetween("foobarbaz", "foo", "baz")) + require.Equal(t, "bar", xstrings.StringBetween("0foobarbaz1", "foo", "baz")) + require.Equal(t, "", xstrings.StringBetween("0foo", "0", "")) + require.Equal(t, "", xstrings.StringBetween("foo0", "", "0")) + require.Equal(t, "", xstrings.StringBetween("", "0", "1")) +} diff --git a/ignite/pkg/xtime/clock_test.go b/ignite/pkg/xtime/clock_test.go index 4d2c72f238..19e9e7683e 100644 --- a/ignite/pkg/xtime/clock_test.go +++ b/ignite/pkg/xtime/clock_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/xtime" + "github.com/ignite/cli/v28/ignite/pkg/xtime" ) func TestClockSystem(t *testing.T) { diff --git a/ignite/pkg/xtime/unix_test.go b/ignite/pkg/xtime/unix_test.go index 4fc370e234..52a647afbb 100644 --- a/ignite/pkg/xtime/unix_test.go +++ b/ignite/pkg/xtime/unix_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/ignite/cli/ignite/pkg/xtime" + "github.com/ignite/cli/v28/ignite/pkg/xtime" "github.com/stretchr/testify/require" ) diff --git a/ignite/pkg/xurl/xurl_test.go b/ignite/pkg/xurl/xurl_test.go index 9032c45fc0..4e27b67fbd 100644 --- a/ignite/pkg/xurl/xurl_test.go +++ b/ignite/pkg/xurl/xurl_test.go @@ -46,18 +46,18 @@ func TestTCP(t *testing.T) { }{ { name: "with scheme", - addr: "tcp://github.com/ignite/cli", - want: "tcp://github.com/ignite/cli", + addr: "tcp://github.com/ignite/cli/v28", + want: "tcp://github.com/ignite/cli/v28", }, { name: "without scheme", - addr: "github.com/ignite/cli", - want: "tcp://github.com/ignite/cli", + addr: "github.com/ignite/cli/v28", + want: "tcp://github.com/ignite/cli/v28", }, { name: "with invalid scheme", - addr: "ftp://github.com/ignite/cli", - want: "tcp://github.com/ignite/cli", + addr: "ftp://github.com/ignite/cli/v28", + want: "tcp://github.com/ignite/cli/v28", }, { name: "with ip and port", @@ -103,18 +103,18 @@ func TestHTTP(t *testing.T) { }{ { name: "with scheme", - addr: "http://github.com/ignite/cli", - want: "http://github.com/ignite/cli", + addr: "http://github.com/ignite/cli/v28", + want: "http://github.com/ignite/cli/v28", }, { name: "without scheme", - addr: "github.com/ignite/cli", - want: "http://github.com/ignite/cli", + addr: "github.com/ignite/cli/v28", + want: "http://github.com/ignite/cli/v28", }, { name: "with invalid scheme", - addr: "ftp://github.com/ignite/cli", - want: "http://github.com/ignite/cli", + addr: "ftp://github.com/ignite/cli/v28", + want: "http://github.com/ignite/cli/v28", }, { name: "with ip and port", @@ -160,18 +160,18 @@ func TestHTTPS(t *testing.T) { }{ { name: "with scheme", - addr: "https://github.com/ignite/cli", - want: "https://github.com/ignite/cli", + addr: "https://github.com/ignite/cli/v28", + want: "https://github.com/ignite/cli/v28", }, { name: "without scheme", - addr: "github.com/ignite/cli", - want: "https://github.com/ignite/cli", + addr: "github.com/ignite/cli/v28", + want: "https://github.com/ignite/cli/v28", }, { name: "with invalid scheme", - addr: "ftp://github.com/ignite/cli", - want: "https://github.com/ignite/cli", + addr: "ftp://github.com/ignite/cli/v28", + want: "https://github.com/ignite/cli/v28", }, { name: "with ip and port", @@ -217,18 +217,18 @@ func TestWS(t *testing.T) { }{ { name: "with scheme", - addr: "ws://github.com/ignite/cli", - want: "ws://github.com/ignite/cli", + addr: "ws://github.com/ignite/cli/v28", + want: "ws://github.com/ignite/cli/v28", }, { name: "without scheme", - addr: "github.com/ignite/cli", - want: "ws://github.com/ignite/cli", + addr: "github.com/ignite/cli/v28", + want: "ws://github.com/ignite/cli/v28", }, { name: "with invalid scheme", - addr: "ftp://github.com/ignite/cli", - want: "ws://github.com/ignite/cli", + addr: "ftp://github.com/ignite/cli/v28", + want: "ws://github.com/ignite/cli/v28", }, { name: "with ip and port", @@ -274,23 +274,23 @@ func TestMightHTTPS(t *testing.T) { }{ { name: "with http scheme", - addr: "http://github.com/ignite/cli", - want: "http://github.com/ignite/cli", + addr: "http://github.com/ignite/cli/v28", + want: "http://github.com/ignite/cli/v28", }, { name: "with https scheme", - addr: "https://github.com/ignite/cli", - want: "https://github.com/ignite/cli", + addr: "https://github.com/ignite/cli/v28", + want: "https://github.com/ignite/cli/v28", }, { name: "without scheme", - addr: "github.com/ignite/cli", - want: "https://github.com/ignite/cli", + addr: "github.com/ignite/cli/v28", + want: "https://github.com/ignite/cli/v28", }, { name: "with invalid scheme", - addr: "ftp://github.com/ignite/cli", - want: "https://github.com/ignite/cli", + addr: "ftp://github.com/ignite/cli/v28", + want: "https://github.com/ignite/cli/v28", }, { name: "with ip and port", diff --git a/ignite/pkg/yaml/map_test.go b/ignite/pkg/yaml/map_test.go index 0491d8b282..afc87e6e4b 100644 --- a/ignite/pkg/yaml/map_test.go +++ b/ignite/pkg/yaml/map_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" - xyaml "github.com/ignite/cli/ignite/pkg/yaml" + xyaml "github.com/ignite/cli/v28/ignite/pkg/yaml" ) func TestUnmarshalWithCustomMapType(t *testing.T) { diff --git a/ignite/services/chain/app.go b/ignite/services/chain/app.go index 716478c8a2..9c5f894e02 100644 --- a/ignite/services/chain/app.go +++ b/ignite/services/chain/app.go @@ -3,8 +3,8 @@ package chain import ( "path/filepath" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) // App keeps info about chain. diff --git a/ignite/services/chain/build.go b/ignite/services/chain/build.go index f10995650a..414fdd3746 100644 --- a/ignite/services/chain/build.go +++ b/ignite/services/chain/build.go @@ -12,16 +12,16 @@ import ( "github.com/moby/moby/pkg/archive" "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/checksum" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/exec" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/dirchange" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/pkg/goanalysis" - "github.com/ignite/cli/ignite/pkg/gocmd" - "github.com/ignite/cli/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/checksum" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/dirchange" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/goanalysis" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) const ( diff --git a/ignite/services/chain/chain.go b/ignite/services/chain/chain.go index 4e8af01382..4c70b1bb55 100644 --- a/ignite/services/chain/chain.go +++ b/ignite/services/chain/chain.go @@ -8,19 +8,19 @@ import ( "github.com/go-git/go-git/v5" - chainconfig "github.com/ignite/cli/ignite/config/chain" - chainconfigv1 "github.com/ignite/cli/ignite/config/chain/v1" - "github.com/ignite/cli/ignite/pkg/chaincmd" - chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - uilog "github.com/ignite/cli/ignite/pkg/cliui/log" - "github.com/ignite/cli/ignite/pkg/confile" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/pkg/repoversion" - "github.com/ignite/cli/ignite/pkg/xexec" - "github.com/ignite/cli/ignite/pkg/xurl" - igniteversion "github.com/ignite/cli/ignite/version" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + chainconfigv1 "github.com/ignite/cli/v28/ignite/config/chain/v1" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + uilog "github.com/ignite/cli/v28/ignite/pkg/cliui/log" + "github.com/ignite/cli/v28/ignite/pkg/confile" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/repoversion" + "github.com/ignite/cli/v28/ignite/pkg/xexec" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + igniteversion "github.com/ignite/cli/v28/ignite/version" ) var appBackendSourceWatchPaths = []string{ diff --git a/ignite/services/chain/faucet.go b/ignite/services/chain/faucet.go index afaf89fd4a..4ec4124344 100644 --- a/ignite/services/chain/faucet.go +++ b/ignite/services/chain/faucet.go @@ -10,10 +10,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pkg/errors" - chainconfig "github.com/ignite/cli/ignite/config/chain" - chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner" - "github.com/ignite/cli/ignite/pkg/cosmosfaucet" - "github.com/ignite/cli/ignite/pkg/xurl" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner" + "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" + "github.com/ignite/cli/v28/ignite/pkg/xurl" ) var ( diff --git a/ignite/services/chain/generate.go b/ignite/services/chain/generate.go index 3660da12eb..5543ad9d91 100644 --- a/ignite/services/chain/generate.go +++ b/ignite/services/chain/generate.go @@ -6,12 +6,12 @@ import ( "os" "path/filepath" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/config/chain/base" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/cosmosgen" - "github.com/ignite/cli/ignite/pkg/events" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/config/chain/base" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" + "github.com/ignite/cli/v28/ignite/pkg/events" ) type generateOptions struct { diff --git a/ignite/services/chain/init.go b/ignite/services/chain/init.go index ced6440c9b..f15b2db322 100644 --- a/ignite/services/chain/init.go +++ b/ignite/services/chain/init.go @@ -8,11 +8,11 @@ import ( "github.com/imdario/mergo" - chainconfig "github.com/ignite/cli/ignite/config/chain" - chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner" - "github.com/ignite/cli/ignite/pkg/cliui/view/accountview" - "github.com/ignite/cli/ignite/pkg/confile" - "github.com/ignite/cli/ignite/pkg/events" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner" + "github.com/ignite/cli/v28/ignite/pkg/cliui/view/accountview" + "github.com/ignite/cli/v28/ignite/pkg/confile" + "github.com/ignite/cli/v28/ignite/pkg/events" ) type ( diff --git a/ignite/services/chain/proto.go b/ignite/services/chain/proto.go index 67fb2503b7..e82ee3b4bb 100644 --- a/ignite/services/chain/proto.go +++ b/ignite/services/chain/proto.go @@ -3,10 +3,10 @@ package chain import ( "path/filepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/pkg/xos" - "github.com/ignite/cli/ignite/templates/app" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xos" + "github.com/ignite/cli/v28/ignite/templates/app" ) var bufFiles = []string{ diff --git a/ignite/services/chain/runtime.go b/ignite/services/chain/runtime.go index fb7e8bf9b9..7bd55f27ef 100644 --- a/ignite/services/chain/runtime.go +++ b/ignite/services/chain/runtime.go @@ -10,10 +10,10 @@ import ( "github.com/nqd/flat" "github.com/pelletier/go-toml" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/chaincmd" - chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner" - "github.com/ignite/cli/ignite/pkg/xurl" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/chaincmd" + chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner" + "github.com/ignite/cli/v28/ignite/pkg/xurl" ) // Gentx wraps the "testd gentx" command for generating a gentx for a validator. diff --git a/ignite/services/chain/serve.go b/ignite/services/chain/serve.go index e02d1b4c00..ef7900c1b3 100644 --- a/ignite/services/chain/serve.go +++ b/ignite/services/chain/serve.go @@ -14,22 +14,22 @@ import ( "github.com/pkg/errors" "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/config" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cache" - chaincmdrunner "github.com/ignite/cli/ignite/pkg/chaincmd/runner" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/cliui/view/accountview" - "github.com/ignite/cli/ignite/pkg/cliui/view/errorview" - "github.com/ignite/cli/ignite/pkg/cosmosfaucet" - "github.com/ignite/cli/ignite/pkg/dirchange" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/pkg/localfs" - "github.com/ignite/cli/ignite/pkg/xexec" - "github.com/ignite/cli/ignite/pkg/xfilepath" - "github.com/ignite/cli/ignite/pkg/xhttp" - "github.com/ignite/cli/ignite/pkg/xurl" + "github.com/ignite/cli/v28/ignite/config" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cache" + chaincmdrunner "github.com/ignite/cli/v28/ignite/pkg/chaincmd/runner" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/cliui/view/accountview" + "github.com/ignite/cli/v28/ignite/pkg/cliui/view/errorview" + "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" + "github.com/ignite/cli/v28/ignite/pkg/dirchange" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/localfs" + "github.com/ignite/cli/v28/ignite/pkg/xexec" + "github.com/ignite/cli/v28/ignite/pkg/xfilepath" + "github.com/ignite/cli/v28/ignite/pkg/xhttp" + "github.com/ignite/cli/v28/ignite/pkg/xurl" ) const ( diff --git a/ignite/services/doctor/doctor.go b/ignite/services/doctor/doctor.go index 87e07b7e9c..ee15cd1dfa 100644 --- a/ignite/services/doctor/doctor.go +++ b/ignite/services/doctor/doctor.go @@ -9,15 +9,15 @@ import ( "github.com/gobuffalo/genny/v2" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/cosmosgen" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/pkg/goanalysis" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/xast" - "github.com/ignite/cli/ignite/templates/app" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/goanalysis" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/xast" + "github.com/ignite/cli/v28/ignite/templates/app" ) const ( diff --git a/ignite/services/doctor/doctor_plugins.go b/ignite/services/doctor/doctor_plugins.go index fdc1ce4bc5..25e5875391 100644 --- a/ignite/services/doctor/doctor_plugins.go +++ b/ignite/services/doctor/doctor_plugins.go @@ -10,11 +10,11 @@ import ( "gopkg.in/yaml.v2" - "github.com/ignite/cli/ignite/config" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cliui/colors" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/config" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cliui/colors" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/events" ) // MigratePluginsConfig migrates plugins config to Ignite App config if required. diff --git a/ignite/services/plugin/cache.go b/ignite/services/plugin/cache.go index bcdce5fa28..35fe104618 100644 --- a/ignite/services/plugin/cache.go +++ b/ignite/services/plugin/cache.go @@ -8,7 +8,7 @@ import ( hplugin "github.com/hashicorp/go-plugin" - "github.com/ignite/cli/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cache" ) const ( diff --git a/ignite/services/plugin/grpc/v1/client_api.pb.go b/ignite/services/plugin/grpc/v1/client_api.pb.go index 95f1c0c403..faf4cf22fc 100644 --- a/ignite/services/plugin/grpc/v1/client_api.pb.go +++ b/ignite/services/plugin/grpc/v1/client_api.pb.go @@ -108,11 +108,11 @@ var file_ignite_services_plugin_grpc_v1_client_api_proto_rawDesc = []byte{ 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x70, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x70, 0x63, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6c, 0x69, - 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x76, 0x32, 0x38, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/ignite/services/plugin/grpc/v1/interface.pb.go b/ignite/services/plugin/grpc/v1/interface.pb.go index aa33de84fa..c16eef1a6a 100644 --- a/ignite/services/plugin/grpc/v1/interface.pb.go +++ b/ignite/services/plugin/grpc/v1/interface.pb.go @@ -708,11 +708,11 @@ var file_ignite_services_plugin_grpc_v1_interface_proto_rawDesc = []byte{ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6c, 0x61, - 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x4f, 0x6e, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, + 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x4f, 0x6e, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6c, - 0x69, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x2f, 0x76, 0x32, 0x38, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/ignite/services/plugin/grpc/v1/service.pb.go b/ignite/services/plugin/grpc/v1/service.pb.go index 11f2012a59..8ed95cc549 100644 --- a/ignite/services/plugin/grpc/v1/service.pb.go +++ b/ignite/services/plugin/grpc/v1/service.pb.go @@ -677,11 +677,11 @@ var file_ignite_services_plugin_grpc_v1_service_proto_rawDesc = []byte{ 0x1a, 0x34, 0x2e, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6c, 0x69, 0x2f, - 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x32, 0x38, 0x2f, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/ignite/services/plugin/grpc/v1/types_command_test.go b/ignite/services/plugin/grpc/v1/types_command_test.go index c74034e656..6b9fbdc98c 100644 --- a/ignite/services/plugin/grpc/v1/types_command_test.go +++ b/ignite/services/plugin/grpc/v1/types_command_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" + v1 "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1" ) func TestCommandToCobraCommand(t *testing.T) { diff --git a/ignite/services/plugin/grpc/v1/types_hook_test.go b/ignite/services/plugin/grpc/v1/types_hook_test.go index 4fed09ed08..aa3d3e771a 100644 --- a/ignite/services/plugin/grpc/v1/types_hook_test.go +++ b/ignite/services/plugin/grpc/v1/types_hook_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" + v1 "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1" ) func TestHookCommandPath(t *testing.T) { diff --git a/ignite/services/plugin/grpc/v1/types_manifest_test.go b/ignite/services/plugin/grpc/v1/types_manifest_test.go index 73246d9c93..6c85d95af3 100644 --- a/ignite/services/plugin/grpc/v1/types_manifest_test.go +++ b/ignite/services/plugin/grpc/v1/types_manifest_test.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/assert" - v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" + v1 "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1" ) func TestManifestImportCobraCommand(t *testing.T) { diff --git a/ignite/services/plugin/interface.go b/ignite/services/plugin/interface.go index 9eb44b008c..532faf8ae5 100644 --- a/ignite/services/plugin/interface.go +++ b/ignite/services/plugin/interface.go @@ -3,7 +3,7 @@ package plugin import ( "context" - v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" + v1 "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1" ) // Flag type aliases. diff --git a/ignite/services/plugin/mocks/client_api.go b/ignite/services/plugin/mocks/client_api.go index 74ea82911d..aad6a6b49f 100644 --- a/ignite/services/plugin/mocks/client_api.go +++ b/ignite/services/plugin/mocks/client_api.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" + v1 "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1" ) // PluginClientAPI is an autogenerated mock type for the ClientAPI type diff --git a/ignite/services/plugin/mocks/interface.go b/ignite/services/plugin/mocks/interface.go index 530177f9b1..644d292d0e 100644 --- a/ignite/services/plugin/mocks/interface.go +++ b/ignite/services/plugin/mocks/interface.go @@ -7,9 +7,9 @@ import ( mock "github.com/stretchr/testify/mock" - plugin "github.com/ignite/cli/ignite/services/plugin" + plugin "github.com/ignite/cli/v28/ignite/services/plugin" - v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" + v1 "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1" ) // PluginInterface is an autogenerated mock type for the Interface type diff --git a/ignite/services/plugin/plugin.go b/ignite/services/plugin/plugin.go index b23a46711b..265bb1c3e5 100644 --- a/ignite/services/plugin/plugin.go +++ b/ignite/services/plugin/plugin.go @@ -18,15 +18,15 @@ import ( hplugin "github.com/hashicorp/go-plugin" "github.com/pkg/errors" - "github.com/ignite/cli/ignite/config" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" - "github.com/ignite/cli/ignite/pkg/cliui/icons" - "github.com/ignite/cli/ignite/pkg/env" - "github.com/ignite/cli/ignite/pkg/events" - "github.com/ignite/cli/ignite/pkg/gocmd" - "github.com/ignite/cli/ignite/pkg/xfilepath" - "github.com/ignite/cli/ignite/pkg/xgit" - "github.com/ignite/cli/ignite/pkg/xurl" + "github.com/ignite/cli/v28/ignite/config" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" + "github.com/ignite/cli/v28/ignite/pkg/cliui/icons" + "github.com/ignite/cli/v28/ignite/pkg/env" + "github.com/ignite/cli/v28/ignite/pkg/events" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/xfilepath" + "github.com/ignite/cli/v28/ignite/pkg/xgit" + "github.com/ignite/cli/v28/ignite/pkg/xurl" ) // PluginsPath holds the plugin cache directory. diff --git a/ignite/services/plugin/plugin_test.go b/ignite/services/plugin/plugin_test.go index 7ddca88daf..84c38b430d 100644 --- a/ignite/services/plugin/plugin_test.go +++ b/ignite/services/plugin/plugin_test.go @@ -17,9 +17,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" - "github.com/ignite/cli/ignite/pkg/gocmd" - "github.com/ignite/cli/ignite/pkg/gomodule" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" ) func TestNewPlugin(t *testing.T) { @@ -522,7 +522,7 @@ func scaffoldPlugin(t *testing.T, dir, name string, sharedHost bool) string { modpath, err := gocmd.Env(gocmd.EnvGOMOD) require.NoError(err) modpath = filepath.Dir(modpath) - err = gomod.AddReplace("github.com/ignite/cli", "", modpath, "") + err = gomod.AddReplace("github.com/ignite/cli/v28", "", modpath, "") require.NoError(err) // Save go.mod data, err := gomod.Format() diff --git a/ignite/services/plugin/protocol.go b/ignite/services/plugin/protocol.go index 0423e2e9b6..6bb3e2431e 100644 --- a/ignite/services/plugin/protocol.go +++ b/ignite/services/plugin/protocol.go @@ -6,7 +6,7 @@ import ( hplugin "github.com/hashicorp/go-plugin" "google.golang.org/grpc" - v1 "github.com/ignite/cli/ignite/services/plugin/grpc/v1" + v1 "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1" ) var handshakeConfig = hplugin.HandshakeConfig{ diff --git a/ignite/services/plugin/scaffold.go b/ignite/services/plugin/scaffold.go index 500e1f6645..006d1bb728 100644 --- a/ignite/services/plugin/scaffold.go +++ b/ignite/services/plugin/scaffold.go @@ -11,8 +11,7 @@ import ( "github.com/gobuffalo/plush/v4" "github.com/pkg/errors" - "github.com/ignite/cli/ignite/pkg/gocmd" - "github.com/ignite/cli/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" ) //go:embed template/* @@ -56,9 +55,5 @@ func Scaffold(ctx context.Context, dir, moduleName string, sharedHost bool) (str return "", errors.WithStack(err) } - if err := gocmd.ModTidy(ctx, finalDir); err != nil { - return "", errors.WithStack(err) - } - return finalDir, nil } diff --git a/ignite/services/plugin/template/go.mod.plush b/ignite/services/plugin/template/go.mod.plush index 650b85a600..71ae3ecdf8 100644 --- a/ignite/services/plugin/template/go.mod.plush +++ b/ignite/services/plugin/template/go.mod.plush @@ -4,5 +4,5 @@ go 1.21 require ( github.com/hashicorp/go-plugin v1.5.0 - github.com/ignite/cli v0.27.2 + github.com/ignite/cli/v28 v28.0.0 ) diff --git a/ignite/services/plugin/template/main.go.plush b/ignite/services/plugin/template/main.go.plush index 83181ccd76..56d8b447c0 100644 --- a/ignite/services/plugin/template/main.go.plush +++ b/ignite/services/plugin/template/main.go.plush @@ -7,8 +7,8 @@ import ( hplugin "github.com/hashicorp/go-plugin" - "github.com/ignite/cli/ignite/services/chain" - "github.com/ignite/cli/ignite/services/plugin" + "github.com/ignite/cli/v28/ignite/services/chain" + "github.com/ignite/cli/v28/ignite/services/plugin" ) type app struct{} diff --git a/ignite/services/scaffolder/component.go b/ignite/services/scaffolder/component.go index eddcbb59e0..579ed3d9ba 100644 --- a/ignite/services/scaffolder/component.go +++ b/ignite/services/scaffolder/component.go @@ -11,9 +11,9 @@ import ( "path/filepath" "strings" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/protoanalysis" - "github.com/ignite/cli/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" ) const ( @@ -48,22 +48,22 @@ func checkComponentValidity(appPath, moduleName string, compName multiformatname func checkComponentCreated(appPath, moduleName string, compName multiformatname.Name, noMessage bool) (err error) { // associate the type to check with the component that scaffold this type typesToCheck := map[string]string{ - compName.UpperCamel: componentType, - "queryall" + compName.LowerCase + "request": componentType, - "queryall" + compName.LowerCase + "response": componentType, - "queryget" + compName.LowerCase + "request": componentType, - "queryget" + compName.LowerCase + "response": componentType, - "query" + compName.LowerCase + "request": componentQuery, - "query" + compName.LowerCase + "response": componentQuery, - compName.LowerCase + "packetdata": componentPacket, + compName.UpperCamel: componentType, + fmt.Sprintf("queryall%srequest", compName.LowerCase): componentType, + fmt.Sprintf("queryall%sresponse", compName.LowerCase): componentType, + fmt.Sprintf("queryget%srequest", compName.LowerCase): componentType, + fmt.Sprintf("queryget%sresponse", compName.LowerCase): componentType, + fmt.Sprintf("query%srequest", compName.LowerCase): componentQuery, + fmt.Sprintf("query%sresponse", compName.LowerCase): componentQuery, + fmt.Sprintf("%spacketdata", compName.LowerCase): componentPacket, } if !noMessage { - typesToCheck["msgcreate"+compName.LowerCase] = componentType - typesToCheck["msgupdate"+compName.LowerCase] = componentType - typesToCheck["msgdelete"+compName.LowerCase] = componentType - typesToCheck["msg"+compName.LowerCase] = componentMessage - typesToCheck["msgsend"+compName.LowerCase] = componentPacket + typesToCheck[fmt.Sprintf("msgcreate%s", compName.LowerCase)] = componentType + typesToCheck[fmt.Sprintf("msgupdate%s", compName.LowerCase)] = componentType + typesToCheck[fmt.Sprintf("msgdelete%s", compName.LowerCase)] = componentType + typesToCheck[fmt.Sprintf("msg%s", compName.LowerCase)] = componentMessage + typesToCheck[fmt.Sprintf("msgsend%s", compName.LowerCase)] = componentPacket } absPath, err := filepath.Abs(filepath.Join(appPath, "x", moduleName, "types")) diff --git a/ignite/services/scaffolder/component_test.go b/ignite/services/scaffolder/component_test.go index 92ddea3775..e154432b7c 100644 --- a/ignite/services/scaffolder/component_test.go +++ b/ignite/services/scaffolder/component_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" ) func TestCheckForbiddenComponentName(t *testing.T) { diff --git a/ignite/services/scaffolder/init.go b/ignite/services/scaffolder/init.go index 5e3b9000ae..f861ebf31f 100644 --- a/ignite/services/scaffolder/init.go +++ b/ignite/services/scaffolder/init.go @@ -8,15 +8,15 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cosmosgen" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgit" - "github.com/ignite/cli/ignite/templates/app" - "github.com/ignite/cli/ignite/templates/field" - modulecreate "github.com/ignite/cli/ignite/templates/module/create" - "github.com/ignite/cli/ignite/templates/testutil" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgit" + "github.com/ignite/cli/v28/ignite/templates/app" + "github.com/ignite/cli/v28/ignite/templates/field" + modulecreate "github.com/ignite/cli/v28/ignite/templates/module/create" + "github.com/ignite/cli/v28/ignite/templates/testutil" ) // Init initializes a new app with name and given options. diff --git a/ignite/services/scaffolder/message.go b/ignite/services/scaffolder/message.go index f475725dea..4bda99594b 100644 --- a/ignite/services/scaffolder/message.go +++ b/ignite/services/scaffolder/message.go @@ -6,14 +6,14 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field" - "github.com/ignite/cli/ignite/templates/field/datatype" - "github.com/ignite/cli/ignite/templates/message" - modulecreate "github.com/ignite/cli/ignite/templates/module/create" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/templates/message" + modulecreate "github.com/ignite/cli/v28/ignite/templates/module/create" ) // messageOptions represents configuration for the message scaffolding. diff --git a/ignite/services/scaffolder/module.go b/ignite/services/scaffolder/module.go index c7f5729227..92fb4b8435 100644 --- a/ignite/services/scaffolder/module.go +++ b/ignite/services/scaffolder/module.go @@ -30,15 +30,15 @@ import ( ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/cache" - appanalysis "github.com/ignite/cli/ignite/pkg/cosmosanalysis/app" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/validation" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field" - "github.com/ignite/cli/ignite/templates/module" - modulecreate "github.com/ignite/cli/ignite/templates/module/create" + "github.com/ignite/cli/v28/ignite/pkg/cache" + appanalysis "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis/app" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/validation" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/module" + modulecreate "github.com/ignite/cli/v28/ignite/templates/module/create" ) const ( diff --git a/ignite/services/scaffolder/oracle.go b/ignite/services/scaffolder/oracle.go index a2a6a0780f..de3c71af6e 100644 --- a/ignite/services/scaffolder/oracle.go +++ b/ignite/services/scaffolder/oracle.go @@ -6,14 +6,14 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/gocmd" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/ibc" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/ibc" ) const ( diff --git a/ignite/services/scaffolder/packet.go b/ignite/services/scaffolder/packet.go index 59e23a2890..ae693e6e74 100644 --- a/ignite/services/scaffolder/packet.go +++ b/ignite/services/scaffolder/packet.go @@ -8,13 +8,13 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field" - "github.com/ignite/cli/ignite/templates/field/datatype" - "github.com/ignite/cli/ignite/templates/ibc" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/templates/ibc" ) const ( diff --git a/ignite/services/scaffolder/patch.go b/ignite/services/scaffolder/patch.go index b51d2c8e9c..2080cd30d8 100644 --- a/ignite/services/scaffolder/patch.go +++ b/ignite/services/scaffolder/patch.go @@ -6,8 +6,8 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/placeholder" - modulecreate "github.com/ignite/cli/ignite/templates/module/create" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + modulecreate "github.com/ignite/cli/v28/ignite/templates/module/create" ) // supportMsgServer checks if the module supports the MsgServer convention diff --git a/ignite/services/scaffolder/query.go b/ignite/services/scaffolder/query.go index 7e4981f0e9..d5b8b33490 100644 --- a/ignite/services/scaffolder/query.go +++ b/ignite/services/scaffolder/query.go @@ -6,12 +6,12 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field" - "github.com/ignite/cli/ignite/templates/query" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/query" ) // AddQuery adds a new query to scaffolded app. diff --git a/ignite/services/scaffolder/scaffolder.go b/ignite/services/scaffolder/scaffolder.go index 6a2dc82f61..c5fc8ae5bb 100644 --- a/ignite/services/scaffolder/scaffolder.go +++ b/ignite/services/scaffolder/scaffolder.go @@ -6,14 +6,14 @@ import ( "context" "path/filepath" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/cosmosanalysis" - "github.com/ignite/cli/ignite/pkg/cosmosgen" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/pkg/gocmd" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/version" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/cosmosanalysis" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/version" ) // Scaffolder is Ignite CLI app scaffolder. diff --git a/ignite/services/scaffolder/type.go b/ignite/services/scaffolder/type.go index 472b790d98..883f1efd12 100644 --- a/ignite/services/scaffolder/type.go +++ b/ignite/services/scaffolder/type.go @@ -7,18 +7,18 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/cache" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field" - "github.com/ignite/cli/ignite/templates/field/datatype" - modulecreate "github.com/ignite/cli/ignite/templates/module/create" - "github.com/ignite/cli/ignite/templates/typed" - "github.com/ignite/cli/ignite/templates/typed/dry" - "github.com/ignite/cli/ignite/templates/typed/list" - maptype "github.com/ignite/cli/ignite/templates/typed/map" - "github.com/ignite/cli/ignite/templates/typed/singleton" + "github.com/ignite/cli/v28/ignite/pkg/cache" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" + modulecreate "github.com/ignite/cli/v28/ignite/templates/module/create" + "github.com/ignite/cli/v28/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/templates/typed/dry" + "github.com/ignite/cli/v28/ignite/templates/typed/list" + maptype "github.com/ignite/cli/v28/ignite/templates/typed/map" + "github.com/ignite/cli/v28/ignite/templates/typed/singleton" ) // AddTypeOption configures options for AddType. diff --git a/ignite/services/scaffolder/type_test.go b/ignite/services/scaffolder/type_test.go index 0cdf3c50d9..6176f8fe49 100644 --- a/ignite/services/scaffolder/type_test.go +++ b/ignite/services/scaffolder/type_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/templates/field" - "github.com/ignite/cli/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" ) func TestParseTypeFields(t *testing.T) { diff --git a/ignite/templates/app/app.go b/ignite/templates/app/app.go index c02ef8af8d..a2815933ad 100644 --- a/ignite/templates/app/app.go +++ b/ignite/templates/app/app.go @@ -8,9 +8,9 @@ import ( "github.com/gobuffalo/genny/v2" "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/cosmosgen" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/pkg/cosmosgen" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" ) //go:embed files/* files/**/* diff --git a/ignite/templates/app/proto.go b/ignite/templates/app/proto.go index 255d4c6377..ab0df00121 100644 --- a/ignite/templates/app/proto.go +++ b/ignite/templates/app/proto.go @@ -5,7 +5,7 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" ) //go:embed files/proto/* files/buf.work.yaml diff --git a/ignite/templates/field/datatype/bool.go b/ignite/templates/field/datatype/bool.go index 29ec545aab..e281d4a456 100644 --- a/ignite/templates/field/datatype/bool.go +++ b/ignite/templates/field/datatype/bool.go @@ -5,8 +5,8 @@ import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" ) // DataBool bool data type definition. diff --git a/ignite/templates/field/datatype/coin.go b/ignite/templates/field/datatype/coin.go index dba4270409..beee6e77bc 100644 --- a/ignite/templates/field/datatype/coin.go +++ b/ignite/templates/field/datatype/coin.go @@ -5,8 +5,8 @@ import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" ) var ( diff --git a/ignite/templates/field/datatype/custom.go b/ignite/templates/field/datatype/custom.go index c5481549ae..486d285fb2 100644 --- a/ignite/templates/field/datatype/custom.go +++ b/ignite/templates/field/datatype/custom.go @@ -5,8 +5,8 @@ import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" ) // DataCustom is a custom data type definition. diff --git a/ignite/templates/field/datatype/int.go b/ignite/templates/field/datatype/int.go index 2ef5e46975..5165ff0bfa 100644 --- a/ignite/templates/field/datatype/int.go +++ b/ignite/templates/field/datatype/int.go @@ -5,8 +5,8 @@ import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" ) var ( diff --git a/ignite/templates/field/datatype/string.go b/ignite/templates/field/datatype/string.go index 3f8934133d..9568caaa72 100644 --- a/ignite/templates/field/datatype/string.go +++ b/ignite/templates/field/datatype/string.go @@ -5,8 +5,8 @@ import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" ) var ( diff --git a/ignite/templates/field/datatype/types.go b/ignite/templates/field/datatype/types.go index 0eec98ce41..ee61f2806e 100644 --- a/ignite/templates/field/datatype/types.go +++ b/ignite/templates/field/datatype/types.go @@ -3,7 +3,7 @@ package datatype import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" ) const ( diff --git a/ignite/templates/field/datatype/types_test.go b/ignite/templates/field/datatype/types_test.go index a622941f81..112706f01c 100644 --- a/ignite/templates/field/datatype/types_test.go +++ b/ignite/templates/field/datatype/types_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" ) func TestIsSupportedType(t *testing.T) { diff --git a/ignite/templates/field/datatype/uint.go b/ignite/templates/field/datatype/uint.go index f952656061..6433a7878a 100644 --- a/ignite/templates/field/datatype/uint.go +++ b/ignite/templates/field/datatype/uint.go @@ -5,8 +5,8 @@ import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" ) var ( diff --git a/ignite/templates/field/field.go b/ignite/templates/field/field.go index 62fdee9115..3407e6c193 100644 --- a/ignite/templates/field/field.go +++ b/ignite/templates/field/field.go @@ -6,8 +6,8 @@ import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" ) // Field represents a field inside a structure for a component diff --git a/ignite/templates/field/fields.go b/ignite/templates/field/fields.go index a87d465f8c..5d1db7e219 100644 --- a/ignite/templates/field/fields.go +++ b/ignite/templates/field/fields.go @@ -3,8 +3,8 @@ package field import ( "fmt" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" ) // Fields represents a Field slice. diff --git a/ignite/templates/field/parse.go b/ignite/templates/field/parse.go index 0956be3e87..d80feb794a 100644 --- a/ignite/templates/field/parse.go +++ b/ignite/templates/field/parse.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" ) // validateField validates the field Name and type, and checks the name is not forbidden by Ignite CLI. diff --git a/ignite/templates/field/parse_test.go b/ignite/templates/field/parse_test.go index 1283e8fadb..cf5b2d3875 100644 --- a/ignite/templates/field/parse_test.go +++ b/ignite/templates/field/parse_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" ) var ( diff --git a/ignite/templates/field/plushhelpers/plushhelpers.go b/ignite/templates/field/plushhelpers/plushhelpers.go index 90ed1b553e..487e3604e1 100644 --- a/ignite/templates/field/plushhelpers/plushhelpers.go +++ b/ignite/templates/field/plushhelpers/plushhelpers.go @@ -5,9 +5,9 @@ import ( "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/xstrings" - "github.com/ignite/cli/ignite/templates/field" - "github.com/ignite/cli/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" ) // ExtendPlushContext sets available field helpers on the provided context. diff --git a/ignite/templates/ibc/oracle.go b/ignite/templates/ibc/oracle.go index 25a031f1ee..1e88ebe1d3 100644 --- a/ignite/templates/ibc/oracle.go +++ b/ignite/templates/ibc/oracle.go @@ -9,13 +9,13 @@ import ( "github.com/gobuffalo/genny/v2" "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" - "github.com/ignite/cli/ignite/templates/module" - "github.com/ignite/cli/ignite/templates/testutil" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/templates/testutil" ) //go:embed files/oracle/* files/oracle/**/* diff --git a/ignite/templates/ibc/packet.go b/ignite/templates/ibc/packet.go index d8a4e5002e..0a3e9c21b4 100644 --- a/ignite/templates/ibc/packet.go +++ b/ignite/templates/ibc/packet.go @@ -11,16 +11,16 @@ import ( "github.com/gobuffalo/genny/v2" "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/pkg/xstrings" - "github.com/ignite/cli/ignite/templates/field" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" - "github.com/ignite/cli/ignite/templates/module" - "github.com/ignite/cli/ignite/templates/testutil" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/templates/testutil" + "github.com/ignite/cli/v28/ignite/templates/typed" ) var ( @@ -191,7 +191,7 @@ func protoModify(opts *PacketOptions) genny.RunFn { if err != nil { return err } - name := xstrings.Title(opts.ModuleName) + "PacketData" + name := fmt.Sprintf("%sPacketData", xstrings.Title(opts.ModuleName)) message, err := protoutil.GetMessageByName(protoFile, name) if err != nil { return fmt.Errorf("failed while looking up '%s' message in %s: %w", name, path, err) @@ -305,7 +305,11 @@ func protoTxModify(opts *PacketOptions) genny.RunFn { return fmt.Errorf("failed while looking up service 'Msg' in %s: %w", path, err) } typenameUpper := opts.PacketName.UpperCamel - send := protoutil.NewRPC("Send"+typenameUpper, "MsgSend"+typenameUpper, "MsgSend"+typenameUpper+"Response") + send := protoutil.NewRPC( + fmt.Sprintf("Send%s", typenameUpper), + fmt.Sprintf("MsgSend%s", typenameUpper), + fmt.Sprintf("MsgSend%sResponse", typenameUpper), + ) protoutil.Append(serviceMsg, send) // Create fields for MsgSend. diff --git a/ignite/templates/message/message.go b/ignite/templates/message/message.go index 4f292bcf90..0546025656 100644 --- a/ignite/templates/message/message.go +++ b/ignite/templates/message/message.go @@ -11,12 +11,12 @@ import ( "github.com/gobuffalo/packd" "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" - "github.com/ignite/cli/ignite/templates/testutil" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/templates/testutil" + "github.com/ignite/cli/v28/ignite/templates/typed" ) var ( @@ -101,7 +101,14 @@ func protoTxRPCModify(opts *Options) genny.RunFn { return fmt.Errorf("failed while looking up service 'Msg' in %s: %w", path, err) } typenameUpper := opts.MsgName.UpperCamel - protoutil.Append(serviceMsg, protoutil.NewRPC(typenameUpper, "Msg"+typenameUpper, "Msg"+typenameUpper+"Response")) + protoutil.Append( + serviceMsg, + protoutil.NewRPC( + typenameUpper, + fmt.Sprintf("Msg%s", typenameUpper), + fmt.Sprintf("Msg%sResponse", typenameUpper), + ), + ) newFile := genny.NewFileS(path, protoutil.Print(protoFile)) return r.File(newFile) diff --git a/ignite/templates/message/options.go b/ignite/templates/message/options.go index c5739e0368..9b8be72ae3 100644 --- a/ignite/templates/message/options.go +++ b/ignite/templates/message/options.go @@ -1,8 +1,8 @@ package message import ( - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/templates/field" ) // Options ... diff --git a/ignite/templates/module/create/base.go b/ignite/templates/module/create/base.go index fa10754043..ba19e4b9da 100644 --- a/ignite/templates/module/create/base.go +++ b/ignite/templates/module/create/base.go @@ -8,12 +8,12 @@ import ( "github.com/gobuffalo/plush/v4" "github.com/iancoleman/strcase" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/pkg/xstrings" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" - "github.com/ignite/cli/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/templates/module" ) // NewGenerator returns the generator to scaffold a module inside an app. diff --git a/ignite/templates/module/create/ibc.go b/ignite/templates/module/create/ibc.go index 506d70e615..92d7ff2eab 100644 --- a/ignite/templates/module/create/ibc.go +++ b/ignite/templates/module/create/ibc.go @@ -7,14 +7,14 @@ import ( "github.com/gobuffalo/genny/v2" "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/pkg/xstrings" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" - "github.com/ignite/cli/ignite/templates/module" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/templates/typed" ) // NewIBC returns the generator to scaffold the implementation of the IBCModule interface inside a module. diff --git a/ignite/templates/module/create/msgserver.go b/ignite/templates/module/create/msgserver.go index 630ca37dd9..706f11f514 100644 --- a/ignite/templates/module/create/msgserver.go +++ b/ignite/templates/module/create/msgserver.go @@ -7,11 +7,11 @@ import ( "github.com/gobuffalo/genny/v2" "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" - "github.com/ignite/cli/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/templates/module" ) const msgServiceImport = `"github.com/cosmos/cosmos-sdk/types/msgservice"` diff --git a/ignite/templates/module/create/options.go b/ignite/templates/module/create/options.go index fc09404a0b..d74dbeab77 100644 --- a/ignite/templates/module/create/options.go +++ b/ignite/templates/module/create/options.go @@ -5,7 +5,7 @@ import ( "github.com/iancoleman/strcase" - "github.com/ignite/cli/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/templates/field" ) type ( diff --git a/ignite/templates/module/module.go b/ignite/templates/module/module.go index c95616077f..f6b77618f8 100644 --- a/ignite/templates/module/module.go +++ b/ignite/templates/module/module.go @@ -4,7 +4,7 @@ import ( "regexp" "strings" - "github.com/ignite/cli/ignite/pkg/xstrings" + "github.com/ignite/cli/v28/ignite/pkg/xstrings" ) // ProtoPackageName creates a protocol buffer package name for an app module. diff --git a/ignite/templates/query/options.go b/ignite/templates/query/options.go index 29da94d95d..e18ba6e8c7 100644 --- a/ignite/templates/query/options.go +++ b/ignite/templates/query/options.go @@ -1,8 +1,8 @@ package query import ( - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/templates/field" ) // Options ... diff --git a/ignite/templates/query/query.go b/ignite/templates/query/query.go index 6483e4e249..c657c16ceb 100644 --- a/ignite/templates/query/query.go +++ b/ignite/templates/query/query.go @@ -12,11 +12,11 @@ import ( "github.com/gobuffalo/packd" "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" ) //go:embed files/* files/**/* @@ -89,7 +89,10 @@ func protoQueryModify(opts *Options) genny.RunFn { } typenameUpper, appModulePath := opts.QueryName.UpperCamel, gomodulepath.ExtractAppPath(opts.ModulePath) - rpcSingle := protoutil.NewRPC(typenameUpper, "Query"+typenameUpper+"Request", "Query"+typenameUpper+"Response", + rpcSingle := protoutil.NewRPC( + typenameUpper, + fmt.Sprintf("Query%sRequest", typenameUpper), + fmt.Sprintf("Query%sResponse", typenameUpper), protoutil.WithRPCOptions( protoutil.NewOption( "google.api.http", diff --git a/ignite/templates/testutil/register.go b/ignite/templates/testutil/register.go index 1263880c69..28fc7ed2fc 100644 --- a/ignite/templates/testutil/register.go +++ b/ignite/templates/testutil/register.go @@ -5,7 +5,7 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" ) //go:embed files/* files/**/* diff --git a/ignite/templates/typed/dry/dry.go b/ignite/templates/typed/dry/dry.go index a75a7fd5eb..57554ed9ec 100644 --- a/ignite/templates/typed/dry/dry.go +++ b/ignite/templates/typed/dry/dry.go @@ -5,8 +5,8 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/typed" ) //go:embed files/component/* files/component/**/* diff --git a/ignite/templates/typed/genesis.go b/ignite/templates/typed/genesis.go index 4b3cef8547..f58fa6cc39 100644 --- a/ignite/templates/typed/genesis.go +++ b/ignite/templates/typed/genesis.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/ignite/cli/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" ) // ProtoGenesisStateMessage is the name of the proto message that represents the genesis state. diff --git a/ignite/templates/typed/list/genesis.go b/ignite/templates/typed/list/genesis.go index b9bd4f81e8..91a64ff73e 100644 --- a/ignite/templates/typed/list/genesis.go +++ b/ignite/templates/typed/list/genesis.go @@ -6,10 +6,10 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/templates/module" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/templates/typed" ) func genesisModify(replacer placeholder.Replacer, opts *typed.Options, g *genny.Generator) { diff --git a/ignite/templates/typed/list/list.go b/ignite/templates/typed/list/list.go index e3603b5ff8..22f72391c1 100644 --- a/ignite/templates/typed/list/list.go +++ b/ignite/templates/typed/list/list.go @@ -11,11 +11,11 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/typed" ) var ( @@ -110,9 +110,21 @@ func protoTxModify(opts *typed.Options) genny.RunFn { // Create, update, delete rpcs. Better to append them altogether, single traversal. typenameUpper := opts.TypeName.UpperCamel protoutil.Append(serviceMsg, - protoutil.NewRPC("Create"+typenameUpper, "MsgCreate"+typenameUpper, "MsgCreate"+typenameUpper+"Response"), - protoutil.NewRPC("Update"+typenameUpper, "MsgUpdate"+typenameUpper, "MsgUpdate"+typenameUpper+"Response"), - protoutil.NewRPC("Delete"+typenameUpper, "MsgDelete"+typenameUpper, "MsgDelete"+typenameUpper+"Response"), + protoutil.NewRPC( + fmt.Sprintf("Create%s", typenameUpper), + fmt.Sprintf("MsgCreate%s", typenameUpper), + fmt.Sprintf("MsgCreate%sResponse", typenameUpper), + ), + protoutil.NewRPC( + fmt.Sprintf("Update%s", typenameUpper), + fmt.Sprintf("MsgUpdate%s", typenameUpper), + fmt.Sprintf("MsgUpdate%sResponse", typenameUpper), + ), + protoutil.NewRPC( + fmt.Sprintf("Delete%s", typenameUpper), + fmt.Sprintf("MsgDelete%s", typenameUpper), + fmt.Sprintf("MsgDelete%sResponse", typenameUpper), + ), ) // - Ensure custom types are imported @@ -142,26 +154,26 @@ func protoTxModify(opts *typed.Options) genny.RunFn { } msgCreate := protoutil.NewMessage( - "MsgCreate"+typenameUpper, + fmt.Sprintf("MsgCreate%s", typenameUpper), protoutil.WithFields(createFields...), protoutil.WithMessageOptions(creatorOpt), ) msgCreateResponse := protoutil.NewMessage( - "MsgCreate"+typenameUpper+"Response", + fmt.Sprintf("MsgCreate%sResponse", typenameUpper), protoutil.WithFields(protoutil.NewField("id", "uint64", 1)), ) msgUpdate := protoutil.NewMessage( - "MsgUpdate"+typenameUpper, + fmt.Sprintf("MsgUpdate%s", typenameUpper), protoutil.WithFields(updateFields...), protoutil.WithMessageOptions(creatorOpt), ) - msgUpdateResponse := protoutil.NewMessage("MsgUpdate" + typenameUpper + "Response") + msgUpdateResponse := protoutil.NewMessage(fmt.Sprintf("MsgUpdate%sResponse", typenameUpper)) msgDelete := protoutil.NewMessage( - "MsgDelete"+typenameUpper, + fmt.Sprintf("MsgDelete%s", typenameUpper), protoutil.WithFields(udfields...), protoutil.WithMessageOptions(creatorOpt), ) - msgDeleteResponse := protoutil.NewMessage("MsgDelete" + typenameUpper + "Response") + msgDeleteResponse := protoutil.NewMessage(fmt.Sprintf("MsgDelete%sResponse", typenameUpper)) protoutil.Append( protoFile, msgCreate, @@ -205,7 +217,10 @@ func protoQueryModify(opts *typed.Options) genny.RunFn { } appModulePath := gomodulepath.ExtractAppPath(opts.ModulePath) typenameUpper := opts.TypeName.UpperCamel - rpcQueryGet := protoutil.NewRPC(typenameUpper, "QueryGet"+typenameUpper+"Request", "QueryGet"+typenameUpper+"Response", + rpcQueryGet := protoutil.NewRPC( + typenameUpper, + fmt.Sprintf("QueryGet%sRequest", typenameUpper), + fmt.Sprintf("QueryGet%sResponse", typenameUpper), protoutil.WithRPCOptions( protoutil.NewOption( "google.api.http", @@ -220,7 +235,10 @@ func protoQueryModify(opts *typed.Options) genny.RunFn { ) protoutil.AttachComment(rpcQueryGet, fmt.Sprintf("Queries a %v by id.", typenameUpper)) - rpcQueryAll := protoutil.NewRPC(typenameUpper+"All", "QueryAll"+typenameUpper+"Request", "QueryAll"+typenameUpper+"Response", + rpcQueryAll := protoutil.NewRPC( + fmt.Sprintf("%sAll", typenameUpper), + fmt.Sprintf("QueryAll%sRequest", typenameUpper), + fmt.Sprintf("QueryAll%sResponse", typenameUpper), protoutil.WithRPCOptions( protoutil.NewOption( "google.api.http", @@ -241,19 +259,21 @@ func protoQueryModify(opts *typed.Options) genny.RunFn { gogoOption := protoutil.NewOption("gogoproto.nullable", "false", protoutil.Custom()) queryGetRequest := protoutil.NewMessage( - "QueryGet"+typenameUpper+"Request", + fmt.Sprintf("QueryGet%sRequest", typenameUpper), protoutil.WithFields(protoutil.NewField("id", "uint64", 1)), ) field := protoutil.NewField(typenameUpper, typenameUpper, 1, protoutil.WithFieldOptions(gogoOption)) - queryGetResponse := protoutil.NewMessage("QueryGet"+typenameUpper+"Response", protoutil.WithFields(field)) + queryGetResponse := protoutil.NewMessage( + fmt.Sprintf("QueryGet%sResponse", typenameUpper), + protoutil.WithFields(field)) queryAllRequest := protoutil.NewMessage( - "QueryAll"+typenameUpper+"Request", + fmt.Sprintf("QueryAll%sRequest", typenameUpper), protoutil.WithFields(protoutil.NewField(paginationName, paginationType+"Request", 1)), ) field = protoutil.NewField(typenameUpper, typenameUpper, 1, protoutil.Repeated(), protoutil.WithFieldOptions(gogoOption)) queryAllResponse := protoutil.NewMessage( - "QueryAll"+typenameUpper+"Response", + fmt.Sprintf("QueryAll%sResponse", typenameUpper), protoutil.WithFields(field, protoutil.NewField(paginationName, paginationType+"Response", 2)), ) protoutil.Append(protoFile, queryGetRequest, queryGetResponse, queryAllRequest, queryAllResponse) diff --git a/ignite/templates/typed/list/simulation.go b/ignite/templates/typed/list/simulation.go index d71c455214..3e285953ac 100644 --- a/ignite/templates/typed/list/simulation.go +++ b/ignite/templates/typed/list/simulation.go @@ -6,8 +6,8 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/templates/typed" ) func moduleSimulationModify(replacer placeholder.Replacer, opts *typed.Options) genny.RunFn { diff --git a/ignite/templates/typed/map/map.go b/ignite/templates/typed/map/map.go index 5e60c4b4bb..467060ad2e 100644 --- a/ignite/templates/typed/map/map.go +++ b/ignite/templates/typed/map/map.go @@ -10,13 +10,13 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field/datatype" - "github.com/ignite/cli/ignite/templates/module" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field/datatype" + "github.com/ignite/cli/v28/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/templates/typed" ) var ( @@ -149,7 +149,10 @@ func protoRPCModify(opts *typed.Options) genny.RunFn { return fmt.Errorf("failed while looking up service 'Query' in %s: %w", path, err) } typenameUpper, typenameSnake, typenameLower := opts.TypeName.UpperCamel, opts.TypeName.Snake, opts.TypeName.LowerCamel - rpcQueryGet := protoutil.NewRPC(typenameUpper, "QueryGet"+typenameUpper+"Request", "QueryGet"+typenameUpper+"Response", + rpcQueryGet := protoutil.NewRPC( + typenameUpper, + fmt.Sprintf("QueryGet%sRequest", typenameUpper), + fmt.Sprintf("QueryGet%sResponse", typenameUpper), protoutil.WithRPCOptions( protoutil.NewOption( "google.api.http", @@ -164,7 +167,10 @@ func protoRPCModify(opts *typed.Options) genny.RunFn { ) protoutil.AttachComment(rpcQueryGet, fmt.Sprintf("Queries a %v by index.", typenameUpper)) - rpcQueryAll := protoutil.NewRPC(typenameUpper+"All", "QueryAll"+typenameUpper+"Request", "QueryAll"+typenameUpper+"Response", + rpcQueryAll := protoutil.NewRPC( + fmt.Sprintf("%sAll", typenameUpper), + fmt.Sprintf("QueryAll%sRequest", typenameUpper), + fmt.Sprintf("QueryAll%sResponse", typenameUpper), protoutil.WithRPCOptions( protoutil.NewOption( "google.api.http", @@ -202,20 +208,20 @@ func protoRPCModify(opts *typed.Options) genny.RunFn { } paginationType, paginationName := "cosmos.base.query.v1beta1.Page", "pagination" queryGetRequest := protoutil.NewMessage( - "QueryGet"+typenameUpper+"Request", + fmt.Sprintf("QueryGet%sRequest", typenameUpper), protoutil.WithFields(queryIndexFields...), ) gogoOption := protoutil.NewOption("gogoproto.nullable", "false", protoutil.Custom()) queryGetResponse := protoutil.NewMessage( - "QueryGet"+typenameUpper+"Response", + fmt.Sprintf("QueryGet%sResponse", typenameUpper), protoutil.WithFields(protoutil.NewField(typenameLower, typenameUpper, 1, protoutil.WithFieldOptions(gogoOption))), ) queryAllRequest := protoutil.NewMessage( - "QueryAll"+typenameUpper+"Request", + fmt.Sprintf("QueryAll%sRequest", typenameUpper), protoutil.WithFields(protoutil.NewField(paginationName, paginationType+"Request", 1)), ) queryAllResponse := protoutil.NewMessage( - "QueryAll"+typenameUpper+"Response", + fmt.Sprintf("QueryAll%sResponse", typenameUpper), protoutil.WithFields( protoutil.NewField( typenameLower, @@ -224,7 +230,7 @@ func protoRPCModify(opts *typed.Options) genny.RunFn { protoutil.Repeated(), protoutil.WithFieldOptions(gogoOption), ), - protoutil.NewField(paginationName, paginationType+"Response", 2), + protoutil.NewField(paginationName, fmt.Sprintf("%sResponse", paginationType), 2), ), ) protoutil.Append(protoFile, queryGetRequest, queryGetResponse, queryAllRequest, queryAllResponse) @@ -537,9 +543,21 @@ func protoTxModify(opts *typed.Options) genny.RunFn { // better to append them altogether, single traversal. typenameUpper := opts.TypeName.UpperCamel protoutil.Append(serviceMsg, - protoutil.NewRPC("Create"+typenameUpper, "MsgCreate"+typenameUpper, "MsgCreate"+typenameUpper+"Response"), - protoutil.NewRPC("Update"+typenameUpper, "MsgUpdate"+typenameUpper, "MsgUpdate"+typenameUpper+"Response"), - protoutil.NewRPC("Delete"+typenameUpper, "MsgDelete"+typenameUpper, "MsgDelete"+typenameUpper+"Response"), + protoutil.NewRPC( + fmt.Sprintf("Create%s", typenameUpper), + fmt.Sprintf("MsgCreate%s", typenameUpper), + fmt.Sprintf("MsgCreate%sResponse", typenameUpper), + ), + protoutil.NewRPC( + fmt.Sprintf("Update%s", typenameUpper), + fmt.Sprintf("MsgUpdate%s", typenameUpper), + fmt.Sprintf("MsgUpdate%sResponse", typenameUpper), + ), + protoutil.NewRPC( + fmt.Sprintf("Delete%s", typenameUpper), + fmt.Sprintf("MsgDelete%s", typenameUpper), + fmt.Sprintf("MsgDelete%sResponse", typenameUpper), + ), ) // Messages @@ -577,21 +595,21 @@ func protoTxModify(opts *typed.Options) genny.RunFn { protoutil.WithFields(append(commonFields, fields...)...), protoutil.WithMessageOptions(creatorOpt), ) - msgCreateResponse := protoutil.NewMessage("MsgCreate" + typenameUpper + "Response") + msgCreateResponse := protoutil.NewMessage(fmt.Sprintf("MsgCreate%sResponse", typenameUpper)) msgUpdate := protoutil.NewMessage( "MsgUpdate"+typenameUpper, protoutil.WithFields(append(commonFields, fields...)...), protoutil.WithMessageOptions(creatorOpt), ) - msgUpdateResponse := protoutil.NewMessage("MsgUpdate" + typenameUpper + "Response") + msgUpdateResponse := protoutil.NewMessage(fmt.Sprintf("MsgUpdate%sResponse", typenameUpper)) msgDelete := protoutil.NewMessage( "MsgDelete"+typenameUpper, protoutil.WithFields(commonFields...), protoutil.WithMessageOptions(creatorOpt), ) - msgDeleteResponse := protoutil.NewMessage("MsgDelete" + typenameUpper + "Response") + msgDeleteResponse := protoutil.NewMessage(fmt.Sprintf("MsgDelete%sResponse", typenameUpper)) protoutil.Append(protoFile, msgCreate, msgCreateResponse, msgUpdate, msgUpdateResponse, msgDelete, msgDeleteResponse, ) diff --git a/ignite/templates/typed/map/simulation.go b/ignite/templates/typed/map/simulation.go index 2c41118d54..42e74aca04 100644 --- a/ignite/templates/typed/map/simulation.go +++ b/ignite/templates/typed/map/simulation.go @@ -6,8 +6,8 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/templates/typed" ) func moduleSimulationModify(replacer placeholder.Replacer, opts *typed.Options) genny.RunFn { diff --git a/ignite/templates/typed/options.go b/ignite/templates/typed/options.go index 25f1002577..5c6bc7ed1c 100644 --- a/ignite/templates/typed/options.go +++ b/ignite/templates/typed/options.go @@ -6,9 +6,9 @@ import ( "github.com/emicklei/proto" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/templates/field" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/templates/field" ) // Options ... diff --git a/ignite/templates/typed/simapp.go b/ignite/templates/typed/simapp.go index 26db4a796d..cddba5358c 100644 --- a/ignite/templates/typed/simapp.go +++ b/ignite/templates/typed/simapp.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/ignite/cli/ignite/pkg/multiformatname" - "github.com/ignite/cli/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/multiformatname" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" ) func ModuleSimulationMsgModify( diff --git a/ignite/templates/typed/singleton/simulation.go b/ignite/templates/typed/singleton/simulation.go index 714de80366..e8499899cf 100644 --- a/ignite/templates/typed/singleton/simulation.go +++ b/ignite/templates/typed/singleton/simulation.go @@ -5,8 +5,8 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/templates/typed" ) func moduleSimulationModify(replacer placeholder.Replacer, opts *typed.Options) genny.RunFn { diff --git a/ignite/templates/typed/singleton/singleton.go b/ignite/templates/typed/singleton/singleton.go index 9059678129..d79a33f8e2 100644 --- a/ignite/templates/typed/singleton/singleton.go +++ b/ignite/templates/typed/singleton/singleton.go @@ -11,12 +11,12 @@ import ( "github.com/gobuffalo/genny/v2" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/placeholder" - "github.com/ignite/cli/ignite/pkg/protoanalysis/protoutil" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/module" - "github.com/ignite/cli/ignite/templates/typed" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/placeholder" + "github.com/ignite/cli/v28/ignite/pkg/protoanalysis/protoutil" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/templates/typed" ) var ( @@ -127,7 +127,10 @@ func protoRPCModify(opts *typed.Options) genny.RunFn { } appModulePath := gomodulepath.ExtractAppPath(opts.ModulePath) typenameUpper := opts.TypeName.UpperCamel - rpcQueryGet := protoutil.NewRPC(typenameUpper, "QueryGet"+typenameUpper+"Request", "QueryGet"+typenameUpper+"Response", + rpcQueryGet := protoutil.NewRPC( + typenameUpper, + fmt.Sprintf("QueryGet%sRequest", typenameUpper), + fmt.Sprintf("QueryGet%sResponse", typenameUpper), protoutil.WithRPCOptions( protoutil.NewOption( "google.api.http", @@ -148,7 +151,7 @@ func protoRPCModify(opts *typed.Options) genny.RunFn { field := protoutil.NewField(typenameUpper, typenameUpper, 1, protoutil.WithFieldOptions(protoutil.NewOption("gogoproto.nullable", "false", protoutil.Custom())), ) - queryGetResponse := protoutil.NewMessage("QueryGet"+typenameUpper+"Response", protoutil.WithFields(field)) + queryGetResponse := protoutil.NewMessage(fmt.Sprintf("QueryGet%sResponse", typenameUpper), protoutil.WithFields(field)) protoutil.Append(protoFile, queryGetRequest, queryGetResponse) newFile := genny.NewFileS(path, protoutil.Print(protoFile)) @@ -383,9 +386,21 @@ func protoTxModify(opts *typed.Options) genny.RunFn { // Append create, update, delete rpcs. Better to append them altogether, single traversal. name := opts.TypeName.UpperCamel protoutil.Append(serviceMsg, - protoutil.NewRPC("Create"+name, "MsgCreate"+name, "MsgCreate"+name+"Response"), - protoutil.NewRPC("Update"+name, "MsgUpdate"+name, "MsgUpdate"+name+"Response"), - protoutil.NewRPC("Delete"+name, "MsgDelete"+name, "MsgDelete"+name+"Response"), + protoutil.NewRPC( + fmt.Sprintf("Create%s", name), + fmt.Sprintf("MsgCreate%s", name), + fmt.Sprintf("MsgCreate%sResponse", name), + ), + protoutil.NewRPC( + fmt.Sprintf("Update%s", name), + fmt.Sprintf("MsgUpdate%s", name), + fmt.Sprintf("MsgUpdate%sResponse", name), + ), + protoutil.NewRPC( + fmt.Sprintf("Delete%s", name), + fmt.Sprintf("MsgDelete%s", name), + fmt.Sprintf("MsgDelete%sResponse", name), + ), ) // Ensure custom types are imported @@ -415,19 +430,19 @@ func protoTxModify(opts *typed.Options) genny.RunFn { protoutil.WithFields(fields...), protoutil.WithMessageOptions(creatorOpt), ) - msgCreateResponse := protoutil.NewMessage("MsgCreate" + name + "Response") + msgCreateResponse := protoutil.NewMessage(fmt.Sprintf("MsgCreate%sResponse", name)) msgUpdate := protoutil.NewMessage( "MsgUpdate"+name, protoutil.WithFields(fields...), protoutil.WithMessageOptions(creatorOpt), ) - msgUpdateResponse := protoutil.NewMessage("MsgUpdate" + name + "Response") + msgUpdateResponse := protoutil.NewMessage(fmt.Sprintf("MsgUpdate%sResponse", name)) msgDelete := protoutil.NewMessage( "MsgDelete"+name, protoutil.WithFields(creator), protoutil.WithMessageOptions(creatorOpt), ) - msgDeleteResponse := protoutil.NewMessage("MsgDelete" + name + "Response") + msgDeleteResponse := protoutil.NewMessage(fmt.Sprintf("MsgDelete%sResponse", name)) protoutil.Append(protoFile, msgCreate, msgCreateResponse, msgUpdate, msgUpdateResponse, msgDelete, msgDeleteResponse, ) diff --git a/ignite/templates/typed/typed.go b/ignite/templates/typed/typed.go index d750f64f68..d6ae6779df 100644 --- a/ignite/templates/typed/typed.go +++ b/ignite/templates/typed/typed.go @@ -5,11 +5,11 @@ import ( "github.com/gobuffalo/packd" "github.com/gobuffalo/plush/v4" - "github.com/ignite/cli/ignite/pkg/gomodulepath" - "github.com/ignite/cli/ignite/pkg/xgenny" - "github.com/ignite/cli/ignite/templates/field/plushhelpers" - "github.com/ignite/cli/ignite/templates/module" - "github.com/ignite/cli/ignite/templates/testutil" + "github.com/ignite/cli/v28/ignite/pkg/gomodulepath" + "github.com/ignite/cli/v28/ignite/pkg/xgenny" + "github.com/ignite/cli/v28/ignite/templates/field/plushhelpers" + "github.com/ignite/cli/v28/ignite/templates/module" + "github.com/ignite/cli/v28/ignite/templates/testutil" ) func Box(box packd.Walker, opts *Options, g *genny.Generator) error { diff --git a/ignite/version/version.go b/ignite/version/version.go index 5a2d71cc75..92b7f548cc 100644 --- a/ignite/version/version.go +++ b/ignite/version/version.go @@ -13,12 +13,12 @@ import ( "github.com/blang/semver/v4" "github.com/google/go-github/v48/github" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cmdrunner/exec" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/cosmosver" - "github.com/ignite/cli/ignite/pkg/gitpod" - "github.com/ignite/cli/ignite/pkg/xexec" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/exec" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cosmosver" + "github.com/ignite/cli/v28/ignite/pkg/gitpod" + "github.com/ignite/cli/v28/ignite/pkg/xexec" ) const ( diff --git a/integration/account/cmd_account_test.go b/integration/account/cmd_account_test.go index 0ec564ef1b..c72ef8235d 100644 --- a/integration/account/cmd_account_test.go +++ b/integration/account/cmd_account_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/randstr" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/randstr" + envtest "github.com/ignite/cli/v28/integration" ) const testAccountMnemonic = "develop mansion drum glow husband trophy labor jelly fault run pause inside jazz foil page injury foam oppose fruit chunk segment morning series nation" diff --git a/integration/app.go b/integration/app.go index 5a05b60944..29aceb8dbd 100644 --- a/integration/app.go +++ b/integration/app.go @@ -11,13 +11,13 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" - chainconfig "github.com/ignite/cli/ignite/config/chain" - v1 "github.com/ignite/cli/ignite/config/chain/v1" - "github.com/ignite/cli/ignite/pkg/availableport" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/gocmd" - "github.com/ignite/cli/ignite/pkg/goenv" - "github.com/ignite/cli/ignite/pkg/xurl" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + v1 "github.com/ignite/cli/v28/ignite/config/chain/v1" + "github.com/ignite/cli/v28/ignite/pkg/availableport" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/goenv" + "github.com/ignite/cli/v28/ignite/pkg/xurl" ) const ServeTimeout = time.Minute * 15 diff --git a/integration/app/cmd_app_test.go b/integration/app/cmd_app_test.go index e37082c86e..f6d8b5079a 100644 --- a/integration/app/cmd_app_test.go +++ b/integration/app/cmd_app_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestGenerateAnApp(t *testing.T) { diff --git a/integration/chain/cache_test.go b/integration/chain/cache_test.go index a6edaf1758..d0f59257d0 100644 --- a/integration/chain/cache_test.go +++ b/integration/chain/cache_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestCliWithCaching(t *testing.T) { diff --git a/integration/chain/cmd_serve_test.go b/integration/chain/cmd_serve_test.go index 3638b98804..0c818e691c 100644 --- a/integration/chain/cmd_serve_test.go +++ b/integration/chain/cmd_serve_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/xos" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/xos" + envtest "github.com/ignite/cli/v28/integration" ) func TestServeWithWasm(t *testing.T) { diff --git a/integration/chain/config_test.go b/integration/chain/config_test.go index 11cd1b578d..20d50446ed 100644 --- a/integration/chain/config_test.go +++ b/integration/chain/config_test.go @@ -10,10 +10,10 @@ import ( "github.com/stretchr/testify/require" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/confile" - "github.com/ignite/cli/ignite/pkg/randstr" - envtest "github.com/ignite/cli/integration" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/confile" + "github.com/ignite/cli/v28/ignite/pkg/randstr" + envtest "github.com/ignite/cli/v28/integration" ) func TestOverwriteSDKConfigsAndChainID(t *testing.T) { diff --git a/integration/client.go b/integration/client.go index 7ed43a645b..9e075f2158 100644 --- a/integration/client.go +++ b/integration/client.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/require" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" ) type clientOptions struct { diff --git a/integration/cosmosgen/bank_module_test.go b/integration/cosmosgen/bank_module_test.go index cad5ef8fcc..61ebe1ebcd 100644 --- a/integration/cosmosgen/bank_module_test.go +++ b/integration/cosmosgen/bank_module_test.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/require" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/config/chain/base" - "github.com/ignite/cli/ignite/pkg/xurl" - envtest "github.com/ignite/cli/integration" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/config/chain/base" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + envtest "github.com/ignite/cli/v28/integration" ) func TestBankModule(t *testing.T) { diff --git a/integration/cosmosgen/cosmosgen_composables_test.go b/integration/cosmosgen/cosmosgen_composables_test.go index 4c0bab13f0..0c65326fae 100644 --- a/integration/cosmosgen/cosmosgen_composables_test.go +++ b/integration/cosmosgen/cosmosgen_composables_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestCosmosGenScaffoldComposables(t *testing.T) { diff --git a/integration/cosmosgen/cosmosgen_hooks_test.go b/integration/cosmosgen/cosmosgen_hooks_test.go index ab6fe7877b..10b96fc588 100644 --- a/integration/cosmosgen/cosmosgen_hooks_test.go +++ b/integration/cosmosgen/cosmosgen_hooks_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestCosmosGenScaffoldHooks(t *testing.T) { diff --git a/integration/cosmosgen/cosmosgen_test.go b/integration/cosmosgen/cosmosgen_test.go index 6194194dae..1be472f62f 100644 --- a/integration/cosmosgen/cosmosgen_test.go +++ b/integration/cosmosgen/cosmosgen_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestCosmosGenScaffold(t *testing.T) { diff --git a/integration/cosmosgen/custom_module_test.go b/integration/cosmosgen/custom_module_test.go index 7c7fe996f3..50ac36d6c1 100644 --- a/integration/cosmosgen/custom_module_test.go +++ b/integration/cosmosgen/custom_module_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/require" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/config/chain/base" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/xurl" - envtest "github.com/ignite/cli/integration" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/config/chain/base" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + envtest "github.com/ignite/cli/v28/integration" ) func TestCustomModule(t *testing.T) { diff --git a/integration/doctor/doctor_test.go b/integration/doctor/doctor_test.go index aa6368c284..1a6ac31708 100644 --- a/integration/doctor/doctor_test.go +++ b/integration/doctor/doctor_test.go @@ -7,9 +7,9 @@ import ( "github.com/rogpeppe/go-internal/gotooltest" "github.com/rogpeppe/go-internal/testscript" - "github.com/ignite/cli/ignite/config" - "github.com/ignite/cli/ignite/pkg/xfilepath" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/config" + "github.com/ignite/cli/v28/ignite/pkg/xfilepath" + envtest "github.com/ignite/cli/v28/integration" ) func TestDoctor(t *testing.T) { diff --git a/integration/env.go b/integration/env.go index 477fe00b04..10a2dec793 100644 --- a/integration/env.go +++ b/integration/env.go @@ -17,11 +17,11 @@ import ( "github.com/cenkalti/backoff" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cosmosfaucet" - "github.com/ignite/cli/ignite/pkg/env" - "github.com/ignite/cli/ignite/pkg/gocmd" - "github.com/ignite/cli/ignite/pkg/httpstatuschecker" - "github.com/ignite/cli/ignite/pkg/xurl" + "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" + "github.com/ignite/cli/v28/ignite/pkg/env" + "github.com/ignite/cli/v28/ignite/pkg/gocmd" + "github.com/ignite/cli/v28/ignite/pkg/httpstatuschecker" + "github.com/ignite/cli/v28/ignite/pkg/xurl" ) const ( @@ -71,7 +71,7 @@ func compileBinary(ctx context.Context) { if err != nil { panic(fmt.Sprintf("unable to get working dir: %v", err)) } - pkgs, err := gocmd.List(ctx, wd, []string{"-m", "-f={{.Dir}}", "github.com/ignite/cli"}) + pkgs, err := gocmd.List(ctx, wd, []string{"-m", "-f={{.Dir}}", "github.com/ignite/cli/v28"}) if err != nil { panic(fmt.Sprintf("unable to list ignite cli package: %v", err)) } diff --git a/integration/exec.go b/integration/exec.go index ea84fe496f..36761a6d29 100644 --- a/integration/exec.go +++ b/integration/exec.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" ) type execOptions struct { diff --git a/integration/faucet/faucet_test.go b/integration/faucet/faucet_test.go index 5f3afbc9fe..a8533bd174 100644 --- a/integration/faucet/faucet_test.go +++ b/integration/faucet/faucet_test.go @@ -14,10 +14,10 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/sync/errgroup" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/cosmosfaucet" - "github.com/ignite/cli/ignite/pkg/xurl" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + envtest "github.com/ignite/cli/v28/integration" ) const ( diff --git a/integration/ibc/cmd_ibc_test.go b/integration/ibc/cmd_ibc_test.go index dfe76f62b4..e9c65d33b4 100644 --- a/integration/ibc/cmd_ibc_test.go +++ b/integration/ibc/cmd_ibc_test.go @@ -5,8 +5,8 @@ package ibc_test import ( "testing" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestCreateModuleWithIBC(t *testing.T) { diff --git a/integration/list/cmd_list_test.go b/integration/list/cmd_list_test.go index 96e18b50d3..b6368588f0 100644 --- a/integration/list/cmd_list_test.go +++ b/integration/list/cmd_list_test.go @@ -5,8 +5,8 @@ package list_test import ( "testing" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestGenerateAnAppWithListAndVerify(t *testing.T) { diff --git a/integration/map/cmd_map_test.go b/integration/map/cmd_map_test.go index 88533b09d7..8069e06396 100644 --- a/integration/map/cmd_map_test.go +++ b/integration/map/cmd_map_test.go @@ -6,8 +6,8 @@ import ( "path/filepath" "testing" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestCreateMap(t *testing.T) { diff --git a/integration/network/network_test.go b/integration/network/network_test.go index 092ddd13fb..6e496c9075 100644 --- a/integration/network/network_test.go +++ b/integration/network/network_test.go @@ -14,12 +14,12 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/stretchr/testify/require" - ignitecmd "github.com/ignite/cli/ignite/cmd" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/gomodule" - "github.com/ignite/cli/ignite/pkg/xgit" - envtest "github.com/ignite/cli/integration" + ignitecmd "github.com/ignite/cli/v28/ignite/cmd" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/gomodule" + "github.com/ignite/cli/v28/ignite/pkg/xgit" + envtest "github.com/ignite/cli/v28/integration" ) const ( diff --git a/integration/node/cmd_query_bank_test.go b/integration/node/cmd_query_bank_test.go index 36f164fe07..af4ddfbeb7 100644 --- a/integration/node/cmd_query_bank_test.go +++ b/integration/node/cmd_query_bank_test.go @@ -12,16 +12,16 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/config/chain/base" - "github.com/ignite/cli/ignite/pkg/cliui/entrywriter" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/randstr" - "github.com/ignite/cli/ignite/pkg/xurl" - xyaml "github.com/ignite/cli/ignite/pkg/yaml" - envtest "github.com/ignite/cli/integration" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/config/chain/base" + "github.com/ignite/cli/v28/ignite/pkg/cliui/entrywriter" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/randstr" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + xyaml "github.com/ignite/cli/v28/ignite/pkg/yaml" + envtest "github.com/ignite/cli/v28/integration" ) const ( diff --git a/integration/node/cmd_query_tx_test.go b/integration/node/cmd_query_tx_test.go index 2f48bac772..3407c35ee9 100644 --- a/integration/node/cmd_query_tx_test.go +++ b/integration/node/cmd_query_tx_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/randstr" - "github.com/ignite/cli/ignite/pkg/xurl" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/randstr" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + envtest "github.com/ignite/cli/v28/integration" ) func TestNodeQueryTx(t *testing.T) { diff --git a/integration/node/cmd_tx_bank_send_test.go b/integration/node/cmd_tx_bank_send_test.go index ce1393d725..442c8e9ec7 100644 --- a/integration/node/cmd_tx_bank_send_test.go +++ b/integration/node/cmd_tx_bank_send_test.go @@ -11,15 +11,15 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/stretchr/testify/require" - chainconfig "github.com/ignite/cli/ignite/config/chain" - "github.com/ignite/cli/ignite/config/chain/base" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/cosmosaccount" - "github.com/ignite/cli/ignite/pkg/cosmosclient" - "github.com/ignite/cli/ignite/pkg/randstr" - "github.com/ignite/cli/ignite/pkg/xurl" - xyaml "github.com/ignite/cli/ignite/pkg/yaml" - envtest "github.com/ignite/cli/integration" + chainconfig "github.com/ignite/cli/v28/ignite/config/chain" + "github.com/ignite/cli/v28/ignite/config/chain/base" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/cosmosaccount" + "github.com/ignite/cli/v28/ignite/pkg/cosmosclient" + "github.com/ignite/cli/v28/ignite/pkg/randstr" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + xyaml "github.com/ignite/cli/v28/ignite/pkg/yaml" + envtest "github.com/ignite/cli/v28/integration" ) func waitForNextBlock(env envtest.Env, client cosmosclient.Client) { diff --git a/integration/other_components/cmd_message_test.go b/integration/other_components/cmd_message_test.go index 0d04e86b4f..7a69b5f33c 100644 --- a/integration/other_components/cmd_message_test.go +++ b/integration/other_components/cmd_message_test.go @@ -5,8 +5,8 @@ package other_components_test import ( "testing" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestGenerateAnAppWithMessage(t *testing.T) { diff --git a/integration/other_components/cmd_query_test.go b/integration/other_components/cmd_query_test.go index 94ec3dc46d..5a8269e7dc 100644 --- a/integration/other_components/cmd_query_test.go +++ b/integration/other_components/cmd_query_test.go @@ -5,8 +5,8 @@ package other_components_test import ( "testing" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestGenerateAnAppWithQuery(t *testing.T) { diff --git a/integration/plugin/plugin_test.go b/integration/plugin/plugin_test.go index 9f0fe6268e..bb8dc7ed70 100644 --- a/integration/plugin/plugin_test.go +++ b/integration/plugin/plugin_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - pluginsconfig "github.com/ignite/cli/ignite/config/plugins" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/services/plugin" - envtest "github.com/ignite/cli/integration" + pluginsconfig "github.com/ignite/cli/v28/ignite/config/plugins" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/services/plugin" + envtest "github.com/ignite/cli/v28/integration" ) func TestAddRemovePlugin(t *testing.T) { diff --git a/integration/plugin/testdata/example-plugin/go.mod b/integration/plugin/testdata/example-plugin/go.mod index 8c55a3b462..3878d83b8b 100644 --- a/integration/plugin/testdata/example-plugin/go.mod +++ b/integration/plugin/testdata/example-plugin/go.mod @@ -6,10 +6,11 @@ toolchain go1.21.4 require ( github.com/hashicorp/go-plugin v1.5.2 - github.com/ignite/cli v0.27.1 + github.com/ignite/cli/v28 v28.0.0 ) require ( + dario.cat/mergo v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/acomagu/bufpipe v1.0.4 // indirect @@ -17,6 +18,7 @@ require ( github.com/aymerick/douceur v0.2.0 // indirect github.com/charmbracelet/lipgloss v0.6.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect + github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fatih/structs v1.1.0 // indirect @@ -33,15 +35,14 @@ require ( github.com/gobuffalo/tags/v3 v3.1.4 // indirect github.com/gobuffalo/validate/v3 v3.3.3 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/gorilla/css v1.0.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/kr/pretty v0.3.1 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -72,11 +73,11 @@ require ( golang.org/x/term v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.15.0 // indirect - google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) -replace github.com/ignite/cli => ../../../../ +replace github.com/ignite/cli/v28 => ../../../../ diff --git a/integration/plugin/testdata/example-plugin/main.go b/integration/plugin/testdata/example-plugin/main.go index 4a8b177bf4..2e3c5dee03 100644 --- a/integration/plugin/testdata/example-plugin/main.go +++ b/integration/plugin/testdata/example-plugin/main.go @@ -6,7 +6,7 @@ import ( hplugin "github.com/hashicorp/go-plugin" - "github.com/ignite/cli/ignite/services/plugin" + "github.com/ignite/cli/v28/ignite/services/plugin" ) type p struct{} diff --git a/integration/simulation/simapp_test.go b/integration/simulation/simapp_test.go index 1718cbe59f..84d0b75c49 100644 --- a/integration/simulation/simapp_test.go +++ b/integration/simulation/simapp_test.go @@ -5,8 +5,8 @@ package simulation_test import ( "testing" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestGenerateAnAppAndSimulate(t *testing.T) { diff --git a/integration/single/cmd_singleton_test.go b/integration/single/cmd_singleton_test.go index 38d9891701..8b1f9eaf66 100644 --- a/integration/single/cmd_singleton_test.go +++ b/integration/single/cmd_singleton_test.go @@ -5,8 +5,8 @@ package single_test import ( "testing" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + envtest "github.com/ignite/cli/v28/integration" ) func TestCreateSingleton(t *testing.T) { diff --git a/integration/tx/tx_test.go b/integration/tx/tx_test.go index c67f2ce2cb..ce80f5eb6f 100644 --- a/integration/tx/tx_test.go +++ b/integration/tx/tx_test.go @@ -14,11 +14,11 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/ignite/cli/ignite/pkg/cmdrunner" - "github.com/ignite/cli/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/ignite/pkg/randstr" - "github.com/ignite/cli/ignite/pkg/xurl" - envtest "github.com/ignite/cli/integration" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner" + "github.com/ignite/cli/v28/ignite/pkg/cmdrunner/step" + "github.com/ignite/cli/v28/ignite/pkg/randstr" + "github.com/ignite/cli/v28/ignite/pkg/xurl" + envtest "github.com/ignite/cli/v28/integration" ) func TestSignTxWithDashedAppName(t *testing.T) { diff --git a/proto/ignite/services/plugin/grpc/v1/client_api.proto b/proto/ignite/services/plugin/grpc/v1/client_api.proto index d7b76c7bc0..8be0b43b18 100644 --- a/proto/ignite/services/plugin/grpc/v1/client_api.proto +++ b/proto/ignite/services/plugin/grpc/v1/client_api.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ignite.services.plugin.grpc.v1; -option go_package = "github.com/ignite/cli/ignite/services/plugin/grpc/v1"; +option go_package = "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1"; message ChainInfo { string chain_id = 1; diff --git a/proto/ignite/services/plugin/grpc/v1/interface.proto b/proto/ignite/services/plugin/grpc/v1/interface.proto index 5dcaef4209..ed1b9bae71 100644 --- a/proto/ignite/services/plugin/grpc/v1/interface.proto +++ b/proto/ignite/services/plugin/grpc/v1/interface.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ignite.services.plugin.grpc.v1; -option go_package = "github.com/ignite/cli/ignite/services/plugin/grpc/v1"; +option go_package = "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1"; // ExecutedCommand represents a plugin command under execution. message ExecutedCommand { diff --git a/proto/ignite/services/plugin/grpc/v1/service.proto b/proto/ignite/services/plugin/grpc/v1/service.proto index e35d89f2f5..b6da18a47c 100644 --- a/proto/ignite/services/plugin/grpc/v1/service.proto +++ b/proto/ignite/services/plugin/grpc/v1/service.proto @@ -5,7 +5,7 @@ package ignite.services.plugin.grpc.v1; import "ignite/services/plugin/grpc/v1/client_api.proto"; import "ignite/services/plugin/grpc/v1/interface.proto"; -option go_package = "github.com/ignite/cli/ignite/services/plugin/grpc/v1"; +option go_package = "github.com/ignite/cli/v28/ignite/services/plugin/grpc/v1"; // InterfaceService defines the interface that must be implemented by all plugins. service InterfaceService { diff --git a/scripts/test-coverage b/scripts/test-coverage index c0775c667e..5f23095cd0 100755 --- a/scripts/test-coverage +++ b/scripts/test-coverage @@ -1,7 +1,7 @@ #!/bin/bash set -e -x -go test -v -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... $(go list github.com/ignite/cli/ignite/...) +go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... $(go list github.com/ignite/cli/v28/ignite/...) # append "||true" to grep so if no match the return code stays 0 excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER' || true)" diff --git a/scripts/test-integration b/scripts/test-integration index 21aace2417..f2a96dd338 100755 --- a/scripts/test-integration +++ b/scripts/test-integration @@ -1,3 +1,3 @@ #!/bin/bash -go test -v -timeout 120m github.com/ignite/cli/integration/... +go test -v -timeout 120m github.com/ignite/cli/v28/integration/... diff --git a/scripts/test-unit b/scripts/test-unit index eba3a8c2a4..d701f88b88 100755 --- a/scripts/test-unit +++ b/scripts/test-unit @@ -1,3 +1,3 @@ #!/bin/bash -go test -v github.com/ignite/cli/ignite/... +go test -v github.com/ignite/cli/v28/ignite/...