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

Conversation

@mrlubos
Copy link
Member

@mrlubos mrlubos commented Jun 13, 2025

Closes #1969
Closes #1821
Closes #1660

@bolt-new-by-stackblitz
Copy link

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

@changeset-bot
Copy link

changeset-bot bot commented Jun 13, 2025

🦋 Changeset detected

Latest commit: cfc0abb

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 Minor

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

@vercel
Copy link

vercel bot commented Jun 13, 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 Jun 14, 2025 8:32am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 13, 2025

Open in StackBlitz

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

commit: cfc0abb

@codecov
Copy link

codecov bot commented Jun 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 24.80%. Comparing base (16fb3c7) to head (cfc0abb).
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2172      +/-   ##
==========================================
+ Coverage   22.49%   24.80%   +2.31%     
==========================================
  Files         273      293      +20     
  Lines       25634    27595    +1961     
  Branches      950     1242     +292     
==========================================
+ Hits         5766     6845    +1079     
- Misses      19862    20742     +880     
- Partials        6        8       +2     
Flag Coverage Δ
unittests 24.80% <ø> (+2.31%) ⬆️

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.

if (config.key) {
const field = map.get(config.key)!;
const name = field.map || config.key;
(params[field.in] as Record<string, unknown>)[name] = arg;

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
library input
.

if (field) {
const name = field.map || key;
(params[field.in] as Record<string, unknown>)[name] = value;

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
library input
.
@mrlubos mrlubos marked this pull request as ready for review June 14, 2025 07:58
@@ -2,11 +2,11 @@
import path from 'node:path';

// @ts-ignore
import { customClientPlugin } from '@hey-api/client-custom/plugin';
import { customClientPlugin } from '@hey-api/custom-client/plugin';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import customClientPlugin.
@mrlubos mrlubos force-pushed the feat/client-bundle branch from f2cf721 to cfc0abb Compare June 14, 2025 08:31
@mrlubos mrlubos merged commit a1e1395 into main Jun 14, 2025
17 checks passed
@mrlubos mrlubos deleted the feat/client-bundle branch June 14, 2025 08:36
@github-actions github-actions bot mentioned this pull request Jun 13, 2025
@johnny-mh
Copy link
Contributor

Hi @mrlubos, after updating to @hey-api/openapi-ts@0.73.0, I noticed that the @hey-api/client-* packages are now added directly into the codebase. This seems to allow for faster installation in most cases—thank you for that!

However, the source code under client/* and core/* is causing type errors with my current project settings, which prevents me from bundling it.
build-error.txt

While I could resolve this by modifying my tsconfig.json, I’d prefer to avoid potential side effects without fully verifying them.

Would it be possible to include pre-bundled client.js and client.d.ts files for each @hey-api/client-* package?

@mrlubos
Copy link
Member Author

mrlubos commented Jun 15, 2025

@johnny-mh Can you open a new issue with your tsconfig? I'll fix the types/errors so you'd be able to build the client yourself

@johnny-mh
Copy link
Contributor

@mrlubos I moved the generated files to another package in my monorepo and copied the openapi-ts/tsconfig.json file. After that, everything built successfully without type errors.

I believe that if you change your code to match my tsconfig.json, other projects might run into the same issue. I’ll open an issue if I encounter any other problems.

Thanks again!

@mrlubos
Copy link
Member Author

mrlubos commented Jun 15, 2025

Please open an issue with your config anyway!

@johnny-mh
Copy link
Contributor

Okay I’ll open issue tomorrow

@KiwiKilian
Copy link

KiwiKilian commented Jun 23, 2025

Is there still a possibility to keep using the packages? We now have the core and client files duplicated, as we are generating for multiple OpenAPI specs. Also I would have to disable quite a lot of ESLint rules. The main benefit I see here, that the client is in sync with the version of the generated code. But otherwise it's a bit troublesome in our use case.

@kylecarhart
Copy link

kylecarhart commented Jul 1, 2025

Yeah, I was very reluctant to upgrade past this version. To echo @KiwiKilian , in our use case, we generate multiple clients which would lead to a lot of duplicated code. We need some way to allow for multiple generated clients to share the same core code.

Not to mention that I'm not really a fan of having all this generated core code in our codebase, id much rather it live in the package like it used to... but I could look past that if this issue is fixed.

@mrlubos
Copy link
Member Author

mrlubos commented Jul 1, 2025

@kylecarhart definitely feel free to not upgrade and stay pinned on an older version! But please, please let me know why so I can figure out a way to make both you and me happy with these features 🤝 I'll get to these clients again, it's on my radar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants