ignite / cli

Ignite is a CLI tool and hub designed for constructing Proof of Stake Blockchains rooted in Cosmos-SDK
https://ignite.com
Other
1.25k stars 549 forks source link

`generate ts-client`: generate TS clients for all modules by default #3122

Closed emidev98 closed 1 year ago

emidev98 commented 1 year ago

When scaffolding a new chain or using the command ignite generate ts-client it creates the ts-client folder with the models from the proto directory but does not generate the cosmos or ibc clients that are imported anyway by default in the generated typescript application.

To reproduce

$ ignite scaffold chain hello # you can check the ts-client folder and it will have correctly imported the types for the current project but not the default cosmos or ibc types
$ cd hello
$ ignite generate ts-client

Result after running the command ignite generate ts-client: image

Ignite version?

Ignite CLI version:     v0.25.1
Ignite CLI build date:  2022-10-20T15:52:00Z
Ignite CLI source hash: cc393a9b59a8792b256432fafb472e5ac0738f7c
Cosmos SDK version:     v0.46.3
Your OS:                linux
Your arch:              amd64
Your Node.js version:   v18.12.1
Your go version:        go version go1.18.7 linux/amd64
Your uname -a:          Linux WorkInProgress 5.19.0-16.4-liquorix-amd64 #1 ZEN SMP PREEMPT_DYNAMIC liquorix 5.19-26ubuntu1~focal (2022-1 x86_64 x86_64 x86_64 GNU/Linux
Your cwd:               /home/emi/Documents/github/hello
Is on Gitpod:           false
fadeev commented 1 year ago

Right now to generate code for all modules one has to run the following command:

ignite generate ts-client --clear-cache

I propose we generate code for all modules (including the standard ones) by default without any flags.

fadeev commented 1 year ago

@aljo242 I propose we add this to v0.26 https://github.com/ignite/cli/issues/3274

aljo242 commented 1 year ago

@clockworkgr do you think you can fit this in before the new release?

clockworkgr commented 1 year ago

@aljo242 I can try? but this is on the go side of things....I think @jeronimoalbi already did it for g vuex so may be faster if he has a look?

This is also relevant https://github.com/ignite/cli/issues/3262 and have started a discussion in slack

jeronimoalbi commented 1 year ago

@aljo242 I can try? but this is on the go side of things....I think @jeronimoalbi already did it for g vuex so may be faster if he has a look?

I will take a look at it 👍