Skip to content
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

feat: add scaffold configs and scaffold params commands and start remove placeholders #3770

Merged
merged 62 commits into from
Feb 22, 2024

Conversation

Pantani
Copy link
Collaborator

@Pantani Pantani commented Nov 22, 2023

close #3684

Description

Configs

We can create a chain with a default module and add the configs later:

ignite s chain github.com/Pantani/mars && cd mars
ignite scaffold configs foo bar:uint baz:bool -y

Or we can also create a module with params and add more configs later:

ignite s chain github.com/Pantani/mars && cd mars   
ignite scaffold module foo --module-configs foo:uint,bar:bool -y
ignite scaffold configs baz boo:uint bla:bool --module foo -y

Params

We can create a chain with a default module and add the parameters later:

ignite s chain github.com/Pantani/mars && cd mars
ignite scaffold params foo bar:uint baz:bool -y

Or we can also create a module with params and add more parameters later:

ignite s chain github.com/Pantani/mars && cd mars   
ignite scaffold module foo --params foo:uint,bar:bool -y
ignite scaffold params baz boo:uint bla:bool --module foo -y

This PR also introduces a new way to add code without placeholders!!!

@Pantani Pantani self-assigned this Nov 22, 2023
@Pantani Pantani changed the title feat: add scaffold param command feat: add scaffold params command Nov 23, 2023
@Pantani Pantani marked this pull request as ready for review November 24, 2023 01:21
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

Given the current and the fact this command is additive, doing a ignite s module bar will still scaffold params. How are you supposed to use this command?

@Pantani
Copy link
Collaborator Author

Pantani commented Nov 24, 2023

Given the current and the fact this command is additive, doing a ignite s module bar will still scaffold params. How are you supposed to use this command?

We can create a chain with a default module and add the parameters later:

ignite s chain github.com/Pantani/mars && cd mars
ignite scaffold params foo bar:uint baz:bool -y

Or we can also create a module with params and add more parameters later:

ignite s chain github.com/Pantani/mars && cd mars   
ignite scaffold module foo --params foo:uint,bar:bool -y
ignite scaffold params baz boo:uint bla:bool --module foo -y

Let's create something in the docs about it. wdyt @toschdev ?

@Pantani Pantani requested a review from julienrbrt November 24, 2023 13:15
@Pantani Pantani marked this pull request as ready for review February 20, 2024 19:57
@Pantani Pantani changed the title feat: add scaffold configs and scaffold params commands feat: add scaffold configs and scaffold params commands and start remove placeholders Feb 20, 2024
@Pantani Pantani requested a review from julienrbrt February 20, 2024 19:58
@Pantani Pantani enabled auto-merge (squash) February 21, 2024 18:28
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

🚀 🚀 🚀

xast additions are amazing!

@Pantani Pantani merged commit 2de08af into main Feb 22, 2024
45 of 46 checks passed
@Pantani Pantani deleted the feat/add-params branch February 22, 2024 21:05
julienrbrt added a commit that referenced this pull request May 3, 2024
* feat: backport xast package to v28

Co-authored-by: Danilo Pantani <[email protected]>
julienrbrt pushed a commit that referenced this pull request May 29, 2024
… remove placeholders (#3770)

* add parameters placeholders and modifier

* add scaffold params command

* add changelog

* check if the parameter already exist

* add integration tests and fix some import issues

* improve the scaffolder logic

* improve the log message

* fix the log message

* fix changelog

* fix 28 imports

* remove params module

* add module configs command

* rollbak empty line for proto

* improve code readbility and add unit tests

* fix changelog

* use cli error package

* Update ignite/cmd/scaffold_configs.go

Co-authored-by: Jerónimo Albi <[email protected]>

* apply pr suggestions

* fix some typos

* remove unused vars and casting

* add replacer pkg for goanalysis

* add TODO comment

* add modify call function

* test readbility

* improve organization

* fix the function modifier logic

* fix the arg idente for caller replace

* add more test cases and last fixes

* start replace the params template to the xast

* add append struct param option

* add support to add new struct params

* fix some lint issues

* add small fixes and improve code readbility

* fix append code parser

* fix changelog

---------

Co-authored-by: Pantani <Pantani>
Co-authored-by: Jerónimo Albi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ignite scaffold param <name>:<type> --module <module>
5 participants