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

fix(valibot): use v.isoTimestamp instead of v.isoDateTime for OpenAPI's date-time #2192

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 4 commits into from
Jun 17, 2025

Conversation

Daschi1
Copy link
Contributor

@Daschi1 Daschi1 commented Jun 17, 2025

Fixes #2191

Copy link

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

Copy link

changeset-bot bot commented Jun 17, 2025

🦋 Changeset detected

Latest commit: 7a740ed

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 Jun 17, 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 17, 2025 11:50am

@Daschi1
Copy link
Contributor Author

Daschi1 commented Jun 17, 2025

I have never worked with test snapshots before, but I feel like I am not supposed to edit these files manually? Any guidance on how to update the tests so that they parse would be appreciated!

@mrlubos
Copy link
Member

mrlubos commented Jun 17, 2025

@Daschi1 just need to run pnpm openapi-ts-tests test:update :)

@Daschi1
Copy link
Contributor Author

Daschi1 commented Jun 17, 2025

@Daschi1 just need to run pnpm openapi-ts-tests test:update :)

When I run the command, I get an error:

pnpm openapi-ts-tests test:update

> openapi-ts-monorepo@0.1.0 openapi-ts-tests D:\Projects\openapi-ts
> turbo run $1 --filter="@test/openapi-ts" "test:update"

turbo 2.5.4

  x Missing tasks in project
  `->   x Could not find task `$1` in project

 ELIFECYCLE  Command failed with exit code 1.

Could you please help? I am not familiar with turbo and don't really know how to approach diagnosing this.

@mrlubos
Copy link
Member

mrlubos commented Jun 17, 2025

Hmm I actually haven't seen this error before, it's not very descriptive obviously. The only thing I know you could run into is the need to build the packages first (custom-client and openapi-ts), but I'd expect the error to say as much. If building packages doesn't help and you can't figure out what's the issue quickly let me know and I'll get this change in and fix the snapshots on my end

@Daschi1
Copy link
Contributor Author

Daschi1 commented Jun 17, 2025

Hmm I actually haven't seen this error before, it's not very descriptive obviously. The only thing I know you could run into is the need to build the packages first (custom-client and openapi-ts), but I'd expect the error to say as much. If building packages doesn't help and you can't figure out what's the issue quickly let me know and I'll get this change in and fix the snapshots on my end

I investigated a bit and I think the error stems from the fact that pnpm somehow didn't correctly substitute test:update into $1 for the openapi-ts-tests script in package.json.

So I just ran the command directly (turbo run test:update --filter="@test/openapi-ts"), which initially exited early with some other errors. I then tried building the project, which also threw some errors. Eventually, the command just hung at some point, and after waiting a few minutes, I terminated it.

I ran the turbo command again, and it still didn't complete, and threw some errors and then hung again. (I feel like there might be something wrong with my local copy? 😅)

Somewhere along the process however, the necessary snapshot files appear to have been updated.

Could you please check and confirm that those files are indeed the ones we need?

Copy link

pkg-pr-new bot commented Jun 17, 2025

Open in StackBlitz

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

commit: 7a740ed

Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 24.96%. Comparing base (eb4fb3b) to head (7a740ed).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
packages/openapi-ts/src/plugins/valibot/plugin.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2192   +/-   ##
=======================================
  Coverage   24.96%   24.96%           
=======================================
  Files         296      296           
  Lines       27636    27636           
  Branches     1246     1246           
=======================================
  Hits         6899     6899           
  Misses      20729    20729           
  Partials        8        8           
Flag Coverage Δ
unittests 24.96% <0.00%> (ø)

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.

@mrlubos
Copy link
Member

mrlubos commented Jun 17, 2025

@Daschi1 tests passed, so the answer is yes! Thank you for contributing! I'll release this either today or tomorrow

@mrlubos mrlubos merged commit fcb77c9 into hey-api:main Jun 17, 2025
16 of 17 checks passed
@Daschi1 Daschi1 deleted the patch-1 branch June 17, 2025 12:08
@github-actions github-actions bot mentioned this pull request Jun 17, 2025
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.

Use v.isoTimestamp instead of v.isoDateTime for format: "date-time"
2 participants