这是indexloc提供的服务,不要输入任何密码
Skip to content

refactor(client-fetch): improves client-fetch types to allow usage of ts-reset #2290

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

Merged
merged 3 commits into from
Jul 9, 2025

Conversation

btmnk
Copy link
Contributor

@btmnk btmnk commented Jul 9, 2025

Resolves #2288

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Jul 9, 2025

🦋 Changeset detected

Latest commit: 4a77615

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

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts 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

Copy link

vercel bot commented Jul 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hey-api-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2025 3:45pm

@btmnk
Copy link
Contributor Author

btmnk commented Jul 9, 2025

Hey @mrlubos, looks like I'm missing some changes for the tests as well, but I'm not 100% sure where and how I should update the snapshots.. I'm not that familiar with snapshot testing in the first place..
Could you point me to what I would need to adjust and how I can trigger the same tests locally? Running the test script doesnt seem to run the snapshot tests..

@mrlubos
Copy link
Member

mrlubos commented Jul 9, 2025

@btmnk hey, run pnpm openapi-ts-tests test:update to update snapshots. Can you also add this change to the Next.js client and possibly Axios/Nuxt if they have the same issue?

@btmnk btmnk force-pushed the improves-client-fetch-types branch from eba37f3 to 7b03fcd Compare July 9, 2025 13:41
@btmnk
Copy link
Contributor Author

btmnk commented Jul 9, 2025

@btmnk hey, run pnpm openapi-ts-tests test:update to update snapshots. Can you also add this change to the Next.js client and possibly Axios/Nuxt if they have the same issue?

It seems the pnpm openapi-ts-tests test:update command does not generate or update any files.. The tests itself also all run successfully (except for the performance test but that could be just my machine that's too slow).

I checked the other clients for type errors with ts-reset as well but only client-next hat the same issue. I updated it there as well.

@btmnk
Copy link
Contributor Author

btmnk commented Jul 9, 2025

nvm. Forgot to build after doing the changes in the client.ts. Now I was able to reproduce the failed tests.

After running the build command it did a change in an angular.json file. If that should not be included let me know and I'll remove it from the PR. Not sure why it did that for me..

Copy link

pkg-pr-new bot commented Jul 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@2290
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@2290
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@2290

commit: 4a77615

Copy link

codecov bot commented Jul 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 24.01%. Comparing base (7df6059) to head (4a77615).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...src/plugins/@hey-api/client-fetch/bundle/client.ts 0.00% 4 Missing ⚠️
.../src/plugins/@hey-api/client-next/bundle/client.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2290      +/-   ##
==========================================
- Coverage   24.01%   24.01%   -0.01%     
==========================================
  Files         314      314              
  Lines       28949    28953       +4     
  Branches     1227     1227              
==========================================
  Hits         6953     6953              
- Misses      21987    21991       +4     
  Partials        9        9              
Flag Coverage Δ
unittests 24.01% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

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

Perfect, thank you!

@mrlubos mrlubos merged commit e74c0a0 into hey-api:main Jul 9, 2025
15 of 17 checks passed
@github-actions github-actions bot mentioned this pull request Jul 9, 2025
@btmnk btmnk deleted the improves-client-fetch-types branch July 10, 2025 07:03
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.

client-fetch generated client.ts contains type error when using ts-reset
2 participants