Skip to content

Conversation

@lumtis
Copy link
Contributor

@lumtis lumtis commented Apr 13, 2021

Part of #967

The flag --no-message allows to generate a type without interaction message.
Queries are still generated.

To test:

starport type foo --no-message
starport message makefoo

In msg_server_makefo.go:

// TODO: Handling the message
k.AppendFoo(ctx, types.Foo{}) <---
appd tx app makefoo --from alice

For templates the pattern is:

  • component template represents the template to scaffold the type "component" itself
  • messages template is for scaffolding the messages to interact with the component

That can be discussed, this pattern would be used for other component like indexed type or packet

@lumtis lumtis linked an issue Apr 13, 2021 that may be closed by this pull request
@lumtis lumtis marked this pull request as ready for review April 15, 2021 13:32
@lumtis lumtis requested review from fadeev and ilgooz as code owners April 15, 2021 13:32
fadeev
fadeev previously approved these changes Apr 16, 2021
Copy link
Contributor

@fadeev fadeev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition for advanced users 👍


env.Must(env.Exec("should prevent creating a legacy type with no message",
step.NewSteps(step.New(
step.Exec("starport", "type", "nomessagelegacy", "--no-message", "--legacy"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to support -legacy at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we still have --legacy option, I can remove this test now that we know we'll stop supporting this

@lumtis lumtis merged commit 306f51a into develop Apr 19, 2021
@lumtis lumtis deleted the feat/type-no-crud branch April 19, 2021 07:55
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: scaffold types without CRUD

4 participants