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

Add explicit type for jsr compliance #492

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

wendrul
Copy link

@wendrul wendrul commented Apr 25, 2024

We are trying to publish our client generated through openapi-ts to jsr. However, we run into the following error:

$ npx jsr publish --dry-run

Checking for slow types in the public API...
error[missing-explicit-return-type]: missing explicit return type in the public API
  --> /home/wendrul/windmill-dev/jsr/typescript-client/src/core/CancelablePromise.ts:83:6
   |
83 |   get [Symbol.toStringTag]() {
   |       ^^^^^^^^^^^^^^^^^^^^ this function is missing an explicit return type
   = hint: add an explicit return type to the function

  info: all functions in the public API must have an explicit return type
  docs: https://jsr.io/go/slow-type-missing-explicit-return-type
...

After doing this change the publish command succeeds.

For more info about jsr: https://jsr.io/#why-jsr

To comply with jsr.io, add an explicit return type.
Copy link

stackblitz bot commented Apr 25, 2024

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

Copy link

changeset-bot bot commented Apr 25, 2024

⚠️ No Changeset found

Latest commit: e0ddf4c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Apr 25, 2024

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 Apr 26, 2024 1:27pm

@mrlubos
Copy link
Member

mrlubos commented Apr 25, 2024

Looks good to me, thanks!

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.

Hey @wendrul mind checking the CI fails? Actually I didn't look correctly the first time, you'll want to modify something inside packages/openapi-ts. The file you modified is for the upcoming clients which is WIP :)

Update tests to match the new generated code with the type anotated
getter.
@wendrul
Copy link
Author

wendrul commented Apr 26, 2024

I just changed the test files to add the same type annotation on the getter, however please note that I'm not familiar with how your testing works, so make sure that changing those files makes sense

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.

Since it looks like this isn't the only issue with JSR, how about we wait until they respond?

@wendrul
Copy link
Author

wendrul commented Apr 26, 2024

Yeah there's no rush at all, feel free to use this or close it as you best see fit.

We already found a workaround for now where we just sed this change before publishing to jsr. We also build with --schemas false to avoid the problem from #493.

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.

2 participants