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

refactor: Migration from Survey to Charm huh #30

Merged
merged 4 commits into from
Feb 2, 2025

Conversation

Harsh4902
Copy link
Contributor

@Harsh4902 Harsh4902 commented Jan 31, 2025

Description

  • This PR adds new CLI interface by adopting charm huh, and considers migration from survey because it is not maintained anymore.

Changes

  • all the generators are now using huh.form.
  • changed .gitignore to ignore .DS_Store file of MacOS.

Related Issue(s)

Resolves #13

New CLI

progen

Signed-off-by: Harsh4902 <harshparmar4902@gmail.com>
Signed-off-by: Harsh4902 <harshparmar4902@gmail.com>
@sivaprasadreddy
Copy link
Owner

Thanks for the PR @Harsh4902
I will take a look at it.

Validate(func(str string) error {
return helpers.ValidateApplicationName(str)
}).
Value(&answers.AppName),
Copy link
Owner

Choose a reason for hiding this comment

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

To retain the existing behavior of providing "Default" values, we can initialize answers := ProjectConfig{} with default values.

Default: []string{"Spring Modulith", "Thymeleaf", "Security"},
},
},
}
answers := ProjectConfig{}
Copy link
Owner

Choose a reason for hiding this comment

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

Change answers := ProjectConfig{} to the following:

answers := ProjectConfig{
		AppName:         "myapp",
		GroupID:         "com.mycompany",
		ArtifactID:      "myapp",
		AppVersion:      "1.0.0-SNAPSHOT",
		BasePackage:     "com.mycompany.myapp",
		BuildTool:       "Maven",
		DbType:          "PostgreSQL",
		DbMigrationTool: "Flyway",
		Features:        []string{"Spring Modulith", "Thymeleaf", "Security"},
	}

Default: "Maven",
},
},
}
answers := ProjectConfig{}
Copy link
Owner

Choose a reason for hiding this comment

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

Replace answers := ProjectConfig{} to the following:

answers := ProjectConfig{
		AppName:     "myapp",
		GroupID:     "com.mycompany",
		ArtifactID:  "myapp",
		AppVersion:  "1.0.0-SNAPSHOT",
		BasePackage: "com.mycompany.myapp",
		BuildTool:   "Maven",
	}

},
},
}

answers := ProjectConfig{}
Copy link
Owner

Choose a reason for hiding this comment

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

Change answers := ProjectConfig{} to the following:

answers := ProjectConfig{
		AppName:        "myapp",
		ModulePath:     "github.com/username/myapp",
		RoutingLibrary: "Gin",
	}

Copy link
Owner

@sivaprasadreddy sivaprasadreddy left a comment

Choose a reason for hiding this comment

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

Overall a great job porting the Survey lib to Charm huh 👍

Could you please make the suggested changes to the PR?

Signed-off-by: Harsh4902 <harshparmar4902@gmail.com>
@Harsh4902
Copy link
Contributor Author

@sivaprasadreddy Yes sir. I was thinking the same, but I was not sure. Thank you for suggesting, I have implemented the changes.

Signed-off-by: Harsh4902 <harshparmar4902@gmail.com>
@sivaprasadreddy sivaprasadreddy merged commit 05c088f into sivaprasadreddy:main Feb 2, 2025
1 check passed
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.

Use Charm huh instead of Survey library
2 participants