-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
fix: move CLI to its own package, deprecate huma.NewCLI #291
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #291 +/- ##
==========================================
+ Coverage 95.04% 95.07% +0.02%
==========================================
Files 18 19 +1
Lines 2726 2739 +13
==========================================
+ Hits 2591 2604 +13
Misses 98 98
Partials 37 37 ☔ View full report in Codecov by Sentry. |
I wonder if we could use a build constraint to already prevent building with the legacy code:
// +build !humanewclipackage
and
go build -tags humanewclipackage
|
Co-authored-by: leonklingele <git@leonklingele.de>
Co-authored-by: leonklingele <git@leonklingele.de>
Hi, |
@simonfr thanks for the feedback. Please take a look at https://github.com/danielgtaylor/huma/releases/tag/v2.13.0 The This wasn't a decision taken lightly due to the potential of upsetting people with a small breaking change, however the call was made that it was worth it to enable more people to use Huma. Even if you disagree with this change, I hope you can understand why it was done. |
This PR moves the built-in optional CLI functionality into its own
humacli
package and updates all examples & docs. The existing CLI functionality stays but is marked as deprecated to give people time to move to the new package. Switching is fairly easy:huma.NewCLI
→humacli.New
huma.CLI
→humacli.CLI
huma.Hooks
→humacli.Hooks
huma.WithOptions
→humacli.WithOptions
The plan is to remove the old functionality a few releases from now. This will be a small breaking change to facilitate the removal of some dependencies that are not used by everyone, but will be treated as a bug fix.
Related to #290. This doesn't fix it yet, but sets us on the track to doing so soon.