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(type defs): log type-def generation errors at the end #8448

Merged
merged 21 commits into from
Jun 29, 2023

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented May 29, 2023

Fixes #8423. This just replaces all calls to console.error with errors.push in the type def generate function and all the functions it calls, and logs all the errors at the end. It results in a lot of changes to return types. Let me know if there's a better way to do this, this is just what made the most sense in the shortest amount of time.

Example:

image

@jtoar jtoar added the release:fix This PR is a fix label May 29, 2023
@replay-io
Copy link

replay-io bot commented May 29, 2023

@jtoar jtoar force-pushed the ds-type-gen/fix-error-output branch from e6b9d47 to cc773d7 Compare June 2, 2023 01:40
@jtoar jtoar marked this pull request as ready for review June 2, 2023 01:41
@jtoar
Copy link
Contributor Author

jtoar commented Jun 2, 2023

I have to update a few other generators here too:

  • cell
  • directive
  • page
  • scaffold
  • sdl
  • type-check

@jtoar jtoar added the fixture-ok Override the test project fixture check label Jun 2, 2023
Copy link
Collaborator

@dac09 dac09 left a comment

Choose a reason for hiding this comment

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

Looks fine to me :) - think there's a few more types to sort out!

@dac09
Copy link
Collaborator

dac09 commented Jun 27, 2023

@jtoar going to leave to you to merge, but fixed the type issue!

@jtoar jtoar added this to the v5.4.0 milestone Jun 29, 2023
@jtoar jtoar merged commit a683321 into main Jun 29, 2023
12 checks passed
@jtoar jtoar deleted the ds-type-gen/fix-error-output branch June 29, 2023 20:28
jtoar added a commit that referenced this pull request Jun 29, 2023
* fix(dx): log errors later

* fix test, use better var names

* change test name

* simplify generateTypeDefGraphQLWeb

* fix code gen test

* stop logging empty line

* add error logging to generators too

* Fix final type issue

* try mocking generate

---------

Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>
@jtoar jtoar modified the milestones: v5.4.0, v6.0.0 Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixture-ok Override the test project fixture check release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: yarn rw g types - errors
2 participants