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

fix(schema): HookContext is now typed in schema #3306

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

AshotN
Copy link
Contributor

@AshotN AshotN commented Oct 9, 2023

Summary

This PR updates the generators for *.schema files to include a type for HookContext.

Without typing HookContext<Service> the revolvers experience type issues.

Other Information

With this PR, the only place that the generator doesn't type HookContext is in the logError hook, which can easily be typed to any

After-which, we can remove the default for the HookContext generic. https://github.com/feathersjs/feathers/blob/dove/packages/generators/src/app/templates/declarations.tpl.ts#L30

I propose to replace the default HookContext<S = any> to HookContext<S extends ServiceMethods>

@daffl daffl changed the title fix: HookContext is now typed in schema fix(schema): HookContext is now typed in schema Oct 11, 2023
@daffl daffl merged commit 65fab86 into feathersjs:dove Oct 11, 2023
2 checks passed
@AshotN AshotN deleted the an/generateHookContextType branch October 11, 2023 04:05
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.

2 participants