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

Improve typing of RunResult #165

Merged
merged 1 commit into from
Jan 24, 2023
Merged

Improve typing of RunResult #165

merged 1 commit into from
Jan 24, 2023

Conversation

jvasseur
Copy link
Contributor

This PR adds 2 changes:

  • Add default for generator type in RunResult: this allows typing the result as juste RunResult in places where we don't care of the type of the generator.
  • Improve typing in helpers to make typescript better at infering the generator type: when doing hepers.create(MyGenerator), typescript will now correctly infer the result as RunResult<MyGenerator>

Copy link
Member

@mischah mischah left a comment

Choose a reason for hiding this comment

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

Hej, thanks for the PR. Please have a look at the output of the failing builds. There are some type errors 😬

Improve typing of RunResult:
 - Add default for generator type in RunResult
 - Improve typing in helpers to make typescript better at infering
generator type
@jvasseur
Copy link
Contributor Author

You are right, I needed to propagate the changes in type to a few other methods, the type errors are fixed when running the tests localy, I hope it will be the same on CI.

Copy link
Member

@mischah mischah left a comment

Choose a reason for hiding this comment

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

Jop 👍🏻
The Integration Build failed before.

Still needs a review of mshima 😗

@mshima mshima merged commit e12bf11 into yeoman:main Jan 24, 2023
@mshima
Copy link
Member

mshima commented Jan 24, 2023

Trusting @mischah review.

@jvasseur jvasseur deleted the better-typing branch January 25, 2023 09:28
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.

None yet

3 participants