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(openapi-fetch): simplify createClient types #1530

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

wydengyre
Copy link
Contributor

Changes

Adds a ClientMethod utility type to simplify the object definition of the return type of createClient.

How to Review

This is a refactor adding a utility type and cleaning up some code. All tests should pass and no dependencies should be affected. Have a look at it and see if it seems more readable.

Checklist

None of these apply to this change. It should not affect tests, not affect docs, and not touch the examples.

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

Copy link

changeset-bot bot commented Feb 7, 2024

🦋 Changeset detected

Latest commit: 4765658

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openapi-fetch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@drwpow
Copy link
Owner

drwpow commented Feb 14, 2024

Thanks! I’m in favor of cleanup like this—looks much better. However, something is off, because the tests are failing (the // @ts-expect-errors are actually a critical part of the test—they make sure errors show when they should). But I don’t see why your approach wouldn’t work with some adjustments to fix the tests

@wydengyre wydengyre force-pushed the refactor-simplify-createclient-types branch from e2f64f3 to 4765658 Compare February 14, 2024 04:17
@wydengyre wydengyre changed the title refactor(openapi-typescript): simplify createClient types refactor(openapi-fetch): simplify createClient types Feb 14, 2024
@wydengyre
Copy link
Contributor Author

@drwpow tests are passing when I run locally now

Copy link
Owner

@drwpow drwpow left a comment

Choose a reason for hiding this comment

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

Very nice!

@drwpow drwpow merged commit 61f408a into drwpow:main Feb 15, 2024
6 checks passed
@wydengyre wydengyre deleted the refactor-simplify-createclient-types branch February 15, 2024 09:08
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

2 participants