8000 component scaffolding: provide custom type for field · Issue #1333 · ignite/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

component scaffolding: provide custom type for field #1333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lumtis opened this issue Jul 5, 2021 · 2 comments · Fixed by #1495
Closed

component scaffolding: provide custom type for field #1333

lumtis opened this issue Jul 5, 2021 · 2 comments · Fixed by #1495
Assignees
Labels
component:spn Related to or beneficial for SPN development type:request Feature request.

Comments

@lumtis
Copy link
Contributor
lumtis commented Jul 5, 2021

Is your feature request related to a problem? Please describe.
We currently support string, bool, int32 and uint64 for types. Some component fields require more advanced and custom types

Describe the solution you'd like
The ability to provide a custom type for a field: starport s message foo bar:MyType. When a custom type is provided we perform an analysis of the proto files to check the type exists. Automatically add the necessary import for the file where the type is defined and add the type in the fields

@lumtis lumtis added the type:request Feature request. label Jul 5, 2021
@fadeev fadeev added this to the v0.17 milestone Jul 6, 2021
@fadeev fadeev removed this from the v0.17 milestone Jul 9, 2021
@Pantani
Copy link
Collaborator
Pantani commented Aug 13, 2021

Implementation description:

Scaffold a Coordinator list type:

$ starport s list coordinator address:string validatorID:uint --no-message

Now we can scaffold a message using the Coordinator type:

$ starport s message settle-request coordinator:Coordinator approve:bool

If you try to use another custom type not created yet, it fails. Like bellow, we did not create the Validator type before:

$ starport s message settle-request validator:Validator approve:bool`
the field type Validator doesn't exist

@Pantani Pantani added the component:spn Related to or beneficial for SPN development label Aug 13, 2021
@fadeev
Copy link
Contributor
fadeev commented Aug 13, 2021

I would even argue that adding starport s type ... is warranted in case you don't need CRUD, just the type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:spn Related to or beneficial for SPN development type:request Feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0