ignite / apps

Ignite Apps
https://docs.ignite.com/apps/using-apps
Other
14 stars 3 forks source link

INIT: Enable Extension to Call Ignite Commands #117

Open Pantani opened 4 months ago

Pantani commented 4 months ago

Add the ability to the extension to call the ignite commands

julienrbrt commented 4 months ago

That's already possible like this: https://github.com/ignite/apps/blob/e5cd28a/appregistry/cmd/install.go#L34-L39 Not the best I admit but does the job. What are you thinking about?

Pantani commented 4 months ago

I was doing some tests trying to call the commands through GRPC, but in the end, it was the same solution with overengineer.

https://github.com/ignite/cli/pull/4252

WDYT?

julienrbrt commented 4 months ago

I look actually pretty handy, but it is indeed less flexible than just importing the cobra command. We would need a way to get stderr, stdout from that API. However me may need to use this if we don't want to depend on cobra in extensions.

Pantani commented 4 months ago

The trick to importing the Cobra command is the ignite version. The version from the terminal can be different from the version from the app using an old building. However, using thought GRPC can break the app if the commands change.

julienrbrt commented 4 months ago

Right, 100% agree, adding calling it via grpc is great for that, however we may want the api to do more (outputs, checking version indeed)